Displaying 2 results from an estimated 2 matches for "new_or_exist".
Did you mean:
new_or_edit
2009 Oct 06
1
Problems Processing multiple form elements generated by javascript actions
...="schedules">
<%= render :partial => ''schedule'', :collection =>
@user.schedules %>
</div>
<%= f.submit ''Update My Profile'' %>
<% end %>
User#_schedule.html.erb
<div class="schedule">
<% new_or_existing = schedule.new_record? ? ''new'' : ''existing'' %>
<% prefix = "user[#{new_or_existing}_schedule_attributes][]" %>
<% fields_for prefix, schedule do |schedule_form| -%>
<%= error_messages_for :schedule, :object => schedul...
2009 Feb 25
9
local variables in partials lead to NameError
I know I must be doing something dumb, but I can''t seem to send a
local variable to my partial. The below code leads to the following
error:
NameError in Residential_listings#new
undefined local variable or method `foo'' for #<ActionView::Base:
0x3fb53f8>
I am trying to call the variable ''foo'' in a partial called
_attachment.html.erb, which is nested in