Trying to upgrade a rails app from 2.3.2 to 2.3.11

9 views
Skip to first unread message

Jay

unread,
Jun 29, 2011, 10:29:39 PM6/29/11
to Ruby on Rails: Talk
Hi,
I'm trying to upgrade a rails app to 2.3.11 (from 2.3.2) and I'm
seeing some odd behavior.
I have a link_to_remote call that works in 2.3.2 but not in anything
above that. What I mean by not working is that in my controller I
have a new method that I want to handle a javascript new call and pop
up a form for creating a new user. To get this I have a page with a
link to remote like so:

link_to_remote(image_tag('adduser.gif', :border => "0"),
:url => new_users_path(:id => @reader.journal_id), :method
=> :get)

in my controller I have a new method such as:

def new
@user = User.new
respond_to do |wants|
wants.js
end
end

and a new.rjs.js with something like:
page.replace_html("add_user_window",:partial =>
'new_user_win.html.erb')
page.show("add_user_window")

This works fine in 2.3.2. Trying to upgrade to anything beyond 2.3.2
and the clicking of link to remote doesn't "register" with the
controller as being a JS call and I get an error saying it can't find
a new.html.erb template. I've changed no other code than to upgrade
rails.

Has anyone seen anything like this? I've been trying to read all the
upgrade notes I can get my hands on. I guess I'm looking for ideas,
pointers, suggestions, anything...

Thanks!
Jay

Chirag Singhal

unread,
Jun 29, 2011, 11:50:58 PM6/29/11
to rubyonra...@googlegroups.com
Rename your template from new.rjs.js to new.js.rjs and it should work

Jay

unread,
Jun 30, 2011, 9:31:20 PM6/30/11
to Ruby on Rails: Talk
thanks man!
I'm going to try that right now... that makes a bunch of sense. I
appreciate you taking the time to respond.
Reply all
Reply to author
Forward
0 new messages