Let's say you have a link like this:
<%= link_to "Add Topics", ???, :remote => true, :id => 'edit_topics开发者_C百科_link' %>
What do you put where the ??? is to render a js.erb file in the same directory?
You should have an action in your controller which responds_to with format.js and the route for it.
def action
  ...
  respond_to do |format|
    format.js {}
  end
end
the in routes
resources :something do
  member do
    get or post :action, :as => :blah
  end
end
Then if you run rake routes you will see something like blah_something_path which you can use in link_to
 
         
                                         
                                         
                                         
                                        ![Interactive visualization of a graph in python [closed]](https://www.devze.com/res/2023/04-10/09/92d32fe8c0d22fb96bd6f6e8b7d1f457.gif) 
                                         
                                         
                                         
                                         加载中,请稍侯......
 加载中,请稍侯......
      
精彩评论