ruby script/generate scaffold SurveyOption name:string disable:boolean survey_title:references
rake db:migrate
ruby script/generate controller Admin::Survey_Options
map.namespace :admin do |admin|
admin.resources :survey_options
end
copy all codes in controller/survey_options_controller.rb to controller/admin/survey_options_controller.rb
change redirect_to(@survey_option) to redirect_to([:admin, @survey_option]) and redirect_to(survey_option_url) to redirect_to(admin_survey_options_url)
copy all files in views/survey_options to views/admin/survey_options
edit views/admin/survey_options/edit, index, new, show files.
http://railsforum.com/viewtopic.php?id=21742
http://www.akitaonrails.com/2007/12/12/rolling-with-rails-2-0-the-first-full-tutorial
1 comments:
Nice way you've explained the things!!
Thanks for the tut, this really helped me! :)
Post a Comment