Hi, just looking for “best practice” guidance…
I have a controller method that renders its output with an rhtml view
file. The output can also be updated via an rjs update via an rjs view
file.
I can’t work out if it is possible to have action.rhtml AND action.rjs
and have the correct one called depending on the request. SO, I have
done this:
if I have have “my_action.rhtml” and “my_action_update.rjs”,
then the controller method is :-
def my_action
… action code…
render :action => :my_action_update if request.xhr?
end
This works, but is it the right way, or is there a better way?
Comments appreciated