JohnMerlino
JohnMerlino

Reputation: 3928

Syntax errors in html file

Not exactly sure what the errors are indicating. I am getting the following syntax errors:

compile error
app/views/students/student_fail.html.haml:33: syntax error, unexpected tIDENTIFIER, expecting ')'
... :student_fail_attribute params[:StudentFailState.true], pa...
                              ^
app/views/students/student_fail.html.haml:33: syntax error, unexpected ')', expecting '='
...method], params[:text_method]) 
                              ^
app/views/students/student_fail.html.haml:39: syntax error, unexpected kENSURE, expecting kEND
...\n", -2, false);_erbout;ensure;@haml_buffer = @haml_buffer.u...
                              ^
app/views/students/student_fail.html.haml:40: syntax error, unexpected kENSURE, expecting kEND
app/views/students/student_fail.html.haml:42: syntax error, unexpected $end, expecting kEND

Here's the html:

 :ruby
       fields = if @step == 1
       [ select_tag(:id, options_from_collection_for_select(Student.passed, :id,   :selector_label, @student.id), :size => 10)  ]
    elsif @step == 2
       form_for @student do |f| f.collection_select( :student_fail_attribute params[:StudentFailState.true], params[:value_method], params[:text_method]) 
    end
    #fields << render_sequence_nav(sequence_info, students_path)
    fields << render(:partial => "resources_partials/sequence/nav", :locals => sequence_info.merge({:cancel_url => {:controller => :dashboard}}))

  = render_form { fields }

Thanks for any response.

Upvotes: 0

Views: 640

Answers (1)

Jimmy Stenke
Jimmy Stenke

Reputation: 11220

I think you are missing a comma between :student_fail_attribute and params[:StudentFailState.true].

You might want to think if params[:StudentFailState.true] is supposed to be there at all, unless it returns the collection you will most likely not get the expected results.

Upvotes: 3

Related Questions