From: Andrew Date: 2009-02-19T06:39:55+09:00 Subject: Clilking on a link should replace that link with a form Hi everyone! I'm new to Ruby and JS, and there is a problem I'm trying to solve: I need a link that, when clicked, transforms into a form for inputting data. I have next code: (show.html.erb)
<%= link_to_remote 'New Journal', :url => { :action => :expand_create_form, :controller => :journals, :user_id => @user.id } %>
(expand_create_form.js.rjs) page[:new_journal].replace_html :partial => "create", :object => @user The problem is I don't want to use the controller, is there some shortcut to call rjs code when user clicks on "New Journal" link?