Archive

Posts Tagged ‘rails mycms -d mysql’

How to develop my own CMS using ruby on rails

How to develop my own CMS using ruby on rails

  1. Create project using rails

Rails myCMS –d mysql

  1. Create admin controller

Ruby script/generate controller admin  index 

Rails script/generate controller admin  index

  1. Create  controller home

Ruby script/generate scaffold admin/home  address:text 

Rails script/generate scaffold admin/home  address:text

  1. Edit admin controller ( index)

redirect_to :controller=>”/admin/home”,:action=>”index”

  1. Set route configuration file to redirect the admin/ to admin/home as follows

map.resource  :controller=>”admin”

  1. Set route configuration as follows

Map.namespace(:admin) do |cmsroot|

Cmsroot.resource :home

End

After running server

Browse following link Read more…

Advertisements