Displaying 2 results from an estimated 2 matches for "task_attribut".
Did you mean:
task_attributes
2007 Oct 17
2
Complex Forms (From Railscasts.com)
...ew
3.times { @project.tasks.build }
end
def create
@project = Project.new(params[:project])
if @project.save
flash[:notice] = "Successfully created project."
redirect_to projects_path
else
render :action => ''new''
end
end
# models/project.rb
def task_attributes=(task_attributes)
task_attributes.each do |attributes|
tasks.build(attributes)
end
end
VIEW
<!-- new.rhtml -->
<% form_for :project, :url => projects_path do |f| %>
<p>
Name: <%= f.text_field :name %>
</p>
<% for task in @project.tasks %>...
2007 Oct 24
13
Ryan Bates' Multi-object Forms and the date_select
I think I''ve found a bug with Edge.
I''m trying out Ryan Bates'' multi-object form technique shown in one of
his Rails-casts (railscasts.com/episodes/75). If you use a fields_for
similar to that shown (here: http://pastie.caboo.se/110480), you get a
Server Error 500:
------
Status: 500 Internal Server Error
Conflicting types for parameter containers. Expected an