Hey all,
All I wanted to do was convert a haml file to erb. After doing so, i get
an undefined method `render_sequence_nav'' error message. Even though no
such error happened when it was in haml format. I believe the culprit is
this line which I am converting incorrectly:
#fields << render_sequence_nav(sequence_info, students_path)
This is what I got:
<%:ruby %>
<% sequence_info = {
:label => "Student Fail",
:steps => [ "Select Student", "Enter Criteria" ],
:num_steps => 2,
:selected_step => @step
} %>
<%= render_breadcrumb_trail %>
<%= render :partial => "resources_partials/sequence/header",
:locals
=> sequence_info %>
<%= render :partial =>
"resources_partials/sequence/step_heading",
:locals => sequence_info %>
<%= render :partial => "resources_partials/sequence/errors"
%>
<% form_for(@student, :url => {:action => :student_fail}, :html =>
{:id
=> "sequence", :class => "student fail"}) do |f| %>
<%= f.error_messages %>
<%:ruby %>
<% fields = if @step == 1%>
<%= [ select_tag(:id,
options_from_collection_for_select(Student.failed, :id, :selector_label,
@student.id), :size => 10) ] %>
<% fields = if @step == 2%>
<%= collection_select(:student_fail, :student_fail_state_id,
StudentFailState.all, :id, :key) %>
<%= submit_tag ''Submit'' %>
<% end %>
<% end %>
<div id=''fields''><% fields <<
render_sequence_nav(sequence_info,
students_path) %></div>
<% fields << render(:partial =>
"resources_partials/sequence/nav", :locals =>
sequence_info.merge({:cancel_url => {:controller => :dashboard}})) %>
<%= render_form { fields } %>
<% end %>
Any ideas as to what''s converted incorrectly? Thanks.
--
Posted via http://www.ruby-forum.com/.
--
You received this message because you are subscribed to the Google Groups
"Ruby on Rails: Talk" group.
To post to this group, send email to
rubyonrails-talk-/JYPxA39Uh5TLH3MbocFF+G/Ez6ZCGd0@public.gmane.org
To unsubscribe from this group, send email to
rubyonrails-talk+unsubscribe-/JYPxA39Uh5TLH3MbocFF+G/Ez6ZCGd0@public.gmane.org
For more options, visit this group at
http://groups.google.com/group/rubyonrails-talk?hl=en.
Hey all, All I wanted to do was convert a haml file to erb. After doing so, i get an undefined method `render_sequence_nav'' error message. Even though no such error happened when it was in haml format. I believe the culprit is this line which I am converting incorrectly: #fields << render_sequence_nav(sequence_info, students_path) I converted it to this: <% <div id="fields"> fields </div> << render_sequence_nav(sequence_info, students_path) %> But Rails says " syntax error, unexpected ''<'', expecting kEND ; <div id="fields"> fields </div>... " Thanks for any suggestions. -- View this message in context: http://old.nabble.com/undefined-method-error-appears-in-erb-but-not-haml-tp27734792p27734792.html Sent from the RubyOnRails Users mailing list archive at Nabble.com. -- You received this message because you are subscribed to the Google Groups "Ruby on Rails: Talk" group. To post to this group, send email to rubyonrails-talk-/JYPxA39Uh5TLH3MbocFF+G/Ez6ZCGd0@public.gmane.org To unsubscribe from this group, send email to rubyonrails-talk+unsubscribe-/JYPxA39Uh5TLH3MbocFF+G/Ez6ZCGd0@public.gmane.org For more options, visit this group at http://groups.google.com/group/rubyonrails-talk?hl=en.
Michael Pavling
2010-Feb-28 13:16 UTC
Re: undefined method error appears in erb but not haml
On 28 February 2010 13:00, JohnMerlino <stoicism1-YDxpq3io04c@public.gmane.org> wrote:> I converted it to this: > <% <div id="fields"> fields </div> << render_sequence_nav(sequence_info, ><div id="fields"><%= render_sequence_nav(sequence_info, students_path) %></div> -- You received this message because you are subscribed to the Google Groups "Ruby on Rails: Talk" group. To post to this group, send email to rubyonrails-talk-/JYPxA39Uh5TLH3MbocFF+G/Ez6ZCGd0@public.gmane.org To unsubscribe from this group, send email to rubyonrails-talk+unsubscribe@googlegroups.com. For more options, visit this group at http://groups.google.com/group/rubyonrails-talk?hl=en.