Archive

Posts Tagged ‘namespace usage in ruby on rails’

what you know about MVC (architectural pattern)

November 30, 2010 Leave a comment

Model–View–Controller (MVC) is a software architecture, currently considered an architectural pattern used in software engineering. The pattern isolates “domain logic” (the application logic for the user) from the user interface (input and presentation), permitting independent development, testing and maintenance of each (separation of concerns). Read more…

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…