<% form_for(@vote) do |f| %>
<%= f.error_messages %>
<% @survey_options.each do |survey_option| %>
<table>
<tr>
<td>
<%= f.radio_button 'survey_option_id', survey_option.id %>
<%= f.label(:survey_option, survey_option.name) %>
</td>
</tr>
</table>
<% end %>
<p>
<%= f.submit 'Create' %>
</p>
<% end %>
hidden_field
Posted by
Lon
on Sunday, July 26, 2009
Labels:
RubyonRails
/
Comments: (0)
<%= f.hidden_field :survey_title_id, :value => @survey_title.id %>
Namespace Tutorial
Posted by
Lon
on Saturday, July 25, 2009
Labels:
RubyonRails
/
Comments: (1)
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
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
Better than Bort - BaseApp
Posted by
Lon
on Tuesday, July 14, 2009
Labels:
RubyonRails
/
Comments: (0)
To use BaseApp read the tutorial below
- http://github.com/ariejan/baseapp/tree/master
- http://vladzloteanu.wordpress.com/2009/07/13/rails-startup-app-basecamp-user-authentication/
MySQL Socket
Posted by
Lon
Labels:
MySql,
RubyonRails
/
Comments: (0)
To find the correct path to mysql socket
- mysql_config --socket
Column Properties
Posted by
Lon
on Monday, June 15, 2009
Labels:
RubyonRails
/
Comments: (0)
String - shot character
Text - long string
Integer - no decimal
Boolean - true or false
Float - number with decimal
Date - calendar date
Text - long string
Integer - no decimal
Boolean - true or false
Float - number with decimal
Date - calendar date
Using Bort
Posted by
Lon
Labels:
RubyonRails
/
Comments: (0)
Download and extract Bort - http://github.com/fudgestudios/bort/tree/master
Configure
Command
Configure
- config/settings.yml
- config/database.yml
- db/migrate/bort_migration.rb
Command
- rake db:create
- rake db:migrate