Go to Google Groups Home    Low Pro
Re: Railscasts' complex forms - refactoring with LowPro

Tim Chater <t.cha...@gmail.com>

I should point out that I have sort of been able to solve this by
amending the new action of the tasks controller and adding this to its
responds_to block:

format.js do
  render :update do |page|
    page.insert_html :bottom, :tasks, :partial => 'projects/
task', :object => Task.new
  end
end

The only problem with this is that I've used a remote link, so it's
had to go back to the server, rather than all be done client side as
it was before... is there another way?

On Jan 24, 1:39 pm, Tim Chater <t.cha...@gmail.com> wrote:

> Hello

> I'm sure some of you are familiar with Ryan Bates' weekly tutorials on
> railscasts.com. A few months ago there was a three-part series
> (episodes 73-75) about creating/editing multiple models in one form.
> I'm trying to achieve the same but not use obtrusive things like
> link_to_function.

> Mostly this has been easy enough, but I'm not sure how to rewrite the
> add_task_link function (which Ryan makes into a helper at the end of
> episode 74):

> # projects_helper.rb
> def add_task_link(name)
>   link_to_function name do |page|
>     page.insert_html :bottom, :tasks, :partial => 'task', :object =>
> Task.new
>   end
> end

> How do I deal with this?

> Thanks.