samedi 30 mai 2015

use engine routes instead of main app(wrapper app)

I am implementing rails app in which I have a rails engine as well.

In main app I have a model Marks

class Mark < ActiveRecord::Base

end

Rake routes for Mark is (simple and index page url)

mark_path(`)

Url for this /marks/

and inside the engine also there is a model Mark.

class Test::Mark < ActiveRecord::Base

end

For engine

marks_path

Url for Engine

/test/marks/1

Query

So how can access engine marks_path in engine's model. Currently when use the url_helper in model it return main app routes instead of engine routes.

But I need engine routes.

Aucun commentaire:

Enregistrer un commentaire