This has been asked before, but didn't receive a proper answer:
I have a User
that has Files
. When a File
is updated (via AJAX) I want to refresh the User
view.
I do this in RJS:
page['user'].replace_html :partial => 'users/user'
However, the _user.erb.html
partial references other partials in the users directory, and e.g. for _name.erb.html
Rails complains it can't find the template Files/name
. (I want it to look for Users/name
).
Is there a way to change the context of the view rendering to that of controller Users
? I'd hate to fully-qualify all of the partial rendering requests.