I am just a little bit beyond customizing my scaffolding. Another way of
saying I am a Rails Rookie : )
Here is my problem:
About 50% of the code in my view below is working.
Example:
First Name
However. anything that is contained within <%= /> will not write to the
db.
Example 1:
Hope for the Homeless Youth:
<% @choices.each do |choice| %>
<%= choice.name %>
<% end %>
Example 2:
1A Start Date
<%= date_select ("post","written_on",:start_year =>
1980,:use_month_numbers => false,:include_blank => true,:order =>
[:month,:day,:year])%>
What do I need to do in the controller, model, view, helper, etc to get
it to write these values to the db? My date fields are defined as date
and my question fields as text in mySQL. Below is my new.rhtml code
which is working for 50% of the fields, but again anything with a <%=
xxxxxxx /> will not insert into mySQL db.
Thanks again for your help!
new.rhtml code below.
New ContactNew Contact
First Name
Last Name
Address1
Address2
City
State
Zip
Country
Home Phone
Cell Phone
Work Phone
Other Phone
Work Email
Personal Email
Website
Occupation
Church Affiliation
Hope for the Homeless Youth:
<% @choices.each do |choice| %>
<%= choice.name %>
<% end %>
Personal Ministry Start Date
<%= date_select ("post","written_on",:start_year =>
1980,:use_month_numbers => false,:include_blank => true,:order =>
[:month,:day,:year])%>
Personal Ministry End Date
<%= date_select ("post","written_on",:start_year =>
1980,:use_month_numbers => false,:include_blank => true,:order =>
[:month,:day,:year])%>
1A Start Date
<%= date_select ("post","written_on",:start_year =>
1980,:use_month_numbers => false,:include_blank => true,:order =>
[:month,:day,:year])%>
1A Certificate Date
<%= date_select ("post","written_on",:start_year =>
1980,:use_month_numbers => false,:include_blank => true,:order =>
[:month,:day,:year])%>
1B Start Date
<%= date_select ("post","written_on",:start_year =>
1980,:use_month_numbers => false,:include_blank => true,:order =>
[:month,:day,:year])%>
1B Certificate Date
<%= date_select ("post","written_on",:start_year =>
1980,:use_month_numbers => false,:include_blank => true,:order =>
[:month,:day,:year])%>
2A Start Date
<%= date_select ("post","written_on",:start_year =>
1980,:use_month_numbers => false,:include_blank => true,:order =>
[:month,:day,:year])%>
2A Certificate Date
<%= date_select ("post","written_on",:start_year =>
1980,:use_month_numbers => false,:include_blank => true,:order =>
[:month,:day,:year])%>
2B Start Date
<%= date_select ("post","written_on",:start_year =>
1980,:use_month_numbers => false,:include_blank => true,:order =>
[:month,:day,:year])%>
2B Certificate Date
<%= date_select ("post","written_on",:start_year =>
1980,:use_month_numbers => false,:include_blank => true,:order =>
[:month,:day,:year])%>
3A Start Date
<%= date_select ("post","written_on",:start_year =>
1980,:use_month_numbers => false,:include_blank => true,:order =>
[:month,:day,:year])%>
3A Certificate Date
<%= date_select ("post","written_on",:start_year =>
1980,:use_month_numbers => false,:include_blank => true,:order =>
[:month,:day,:year])%>
RLM Teacher:
<% @choices.each do |choice| %>
<%= choice.name %>
<% end %>
RLM Assistant:
<% @choices.each do |choice| %>
<%= choice.name %>
<% end %>
RLM Board Member:
<% @ choices.each do |choice| %>
<%= choice.name %>
<% end %>
RLM Donor:
<% @choices.each do |choice| %>
<%= choice.name %>
<% end %>
RLM Volunteer:
<% @choices.each do |choice| %>
<%= choice.name %>
<% end %>
RLM Gifting
Notes
below is my controllers
class RlmController < ApplicationController
scaffold :rlm
def new
@rlms = Rlm.new
@choices = Choice.find_all
end
def edit
@rlm = Rlm.find(@params["id"])
@choices = Choice.find_all
end
end
class ChoiceController < ApplicationController
scaffold :choice
end
below are my models
class Rlm < ActiveRecord::Base
belongs_to :choice
end
class Choice < ActiveRecord::Base
has_many :rlms
end