Url_for and :defaults


in my routes there are (just for testing):

map.connect ‘:controller/:id/:action’, :defaults => {:action => ‘alma’}

in my controller:

    def alma
            render :text => url_for(:id => 123)

so I go to:


which generates:


Where the action is not correct, it should be “alma” instead of “index”

What do I wrong?


Excuse me, I have to correct myself.

This thing only happen if I define the :controller to.

So the real code pieces look like:

render :text => url_for(:controller: ‘store’, :id => 123)

Where store is the actual controller.

Should I send a bug report?

This forum is not affiliated to the Ruby language, Ruby on Rails framework, nor any Ruby applications discussed here.

| Privacy Policy | Terms of Service | Remote Ruby Jobs