How to integrate frontend and admin theme together in ruby on rails -


i have application admin in ruby on rails. need add front-end in application. don't know how ingrate both in single application.

you can create "admin" area pretty once know how. comes down namespaces, specifically:

#config/routes.rb namespace :admin    # sets "/admin"    root "application#index"  end 

namespaces "folders", influence names of rails classes (for example, controller class names).

this means you'll able use following:

#app/controllers/admin/application_controller.rb class admin::applicationcontroller < actioncontroller::base     layout :admin     def index        #do stuff here     end end 

your models remain (no need make them admin namespaced).

--

the above code should give ability access yoururl.com/admin , have controller/action work with. of course, negates fact you're going have populate area data & controller actions; works "standard" rails app once working.

you'll want check out these helpful resources:

enter image description here


Comments

Popular posts from this blog

java - Date formats difference between yyyy-MM-dd'T'HH:mm:ss and yyyy-MM-dd'T'HH:mm:ssXXX -

c# - Get rid of xmlns attribute when adding node to existing xml -