Last active
December 11, 2015 12:38
-
-
Save NigelThorne/4601963 to your computer and use it in GitHub Desktop.
Problem going to Rails 3
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<li class='step'> | |
<%= sf.hidden_field :id %> | |
<%= sf.hidden_field :step_definition_id %> | |
<%= sf.hidden_field :position ,:class=>"position"%> | |
<%= sf.object.format_with_params { |param| render(:partial=>'scenarios/param' , :locals=>{:param=> param, :sf=>sf})} %> | |
<% if sf.object.new_record? %> | |
<%= link_to "Remove", '#', :onclick =>"$(this).parent('.step').remove()" %> | |
<% else %> | |
<%= sf.check_box '_destroy' %> | |
<%= sf.label '_destroy', 'Remove' %> | |
<% end %> | |
</li> |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<% | |
@ff = ActionView::Helpers::FormBuilder.new(:scenario, @step.scenario || Scenario.new, @template, {}, proc {} ) | |
@sf = nil | |
@ff.fields_for(:steps, @step, {:child_index => @next_index}) {|sf| @sf = sf} | |
form = render(:partial => 'scenarios/step', :locals => { :sf=> @sf, :step => @step }) | |
%> | |
$("#placeholder<%=@next_index%>").replaceWith("<%= escape_javascript form %>"); | |
$("input/.position").each(function(index){$(this).val(index+1);}); |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
ActionView::Template::Error (undefined method
fields_for' for nil:NilClass): 2: @sf = nil 3: @fx = ActionView::Helpers::FormBuilder.new(:scenario, @step.scenario || Scenario.new, @template, {}, proc {} ) 4: @form = nil 5: @fx.send(:fields_for, :steps, @step, {:child_index => @next_index}) {|sf| 6: 7: # @form = render(:partial => 'scenarios/step', :locals => { :sf=> sf, :step => @step }) 8: } app/views/steps/new.js.erb:5:in
_app_views_steps_new_js_erb___870977895_19276944'