Q:

Is it possible to move Ruby code from the controller in to a '.js.rjs' file?

I am using Ruby on Rails 3 and for a correct organization of my code I would like to have the whole AJAX code related to an action in a respectively 'action.js.rjs' file.
For example, if I have code in a controller like this:
def action
  ...

  format.js {
    # BEGIN code to move in to the 'action.js.rjs' file
    responds_to_parent do
      ...
    end
    # END code to move in to the 'action.js.rjs' file
  }

end

is it possible to move in some way the 'responds_to_parent' statement or its content from the controller in to the 'action.js.rjs' file and make it to work?

A:

SOLVED
This should work:
    responds_to_parent do
      render :action => 'update.js.rjs'
    end

