Sign Up

Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.

Have an account? Sign In

Have an account? Sign In Now

Sign In

Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.

Sign Up Here

Forgot Password?

Don't have account, Sign Up Here

Forgot Password

Lost your password? Please enter your email address. You will receive a link and will create a new password via email.

Have an account? Sign In Now

You must login to ask a question.

Forgot Password?

Need An Account, Sign Up Here

Please briefly explain why you feel this question should be reported.

Please briefly explain why you feel this answer should be reported.

Please briefly explain why you feel this user should be reported.

Sign InSign Up

The Archive Base

The Archive Base Logo The Archive Base Logo

The Archive Base Navigation

  • SEARCH
  • Home
  • About Us
  • Blog
  • Contact Us
Search
Ask A Question

Mobile menu

Close
Ask a Question
  • Home
  • Add group
  • Groups page
  • Feed
  • User Profile
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Buy Points
  • Users
  • Help
  • Buy Theme
  • SEARCH
Home/ Questions/Q 7042429
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 28, 20262026-05-28T02:10:02+00:00 2026-05-28T02:10:02+00:00

Using Rails 3.2.0.rc2 and ruby 1.9.3p0 In app/views/requests/_form.html.erb I have the following code for

  • 0

Using Rails 3.2.0.rc2 and ruby 1.9.3p0

In app/views/requests/_form.html.erb I have the following code for showing radio buttons to set the value of :req_driverage (@requests.req_driverage) (in the database, table requests has column req_driverage of type integer):

<%= f.label "Authorized age:" %>
<%= radio_button_tag(:req_driverage, "0") %>
<%= label_tag(:req_driverage_0, "Any driver aged 21 years and over") %>
<%= radio_button_tag(:req_driverage, "1") %>
<%= label_tag(:req_driverage_1, "Any driver aged 25 years and over") %>
<%= radio_button_tag(:req_driverage, "2") %>
<%= label_tag(:req_driverage_2, "Any driver aged 30 years and over") %>

Before sending this through actionmailer, I am viewing the value of @request.req_driverage in the log file:

logger.info("Value is #{@request.req_driverage}")

However, this is only showing “Value is “, meaning that the value is nil (undefined?), even though it has been selected before creating the object.

The strange thing is that I am seeing

"req_driverage"=>"1",

(if radio button option two was selected) in the browser, when I comment out the call to mail in the actionmailer file and get the error A sender (Return-Path, Sender or From) required to send a message.

Can anyone please guide me on what is wrong with the above erb code? Or point me to where the value of req_driverage is being changed?

Thanks

  • 1 1 Answer
  • 0 Views
  • 0 Followers
  • 0
Share
  • Facebook
  • Report

Leave an answer
Cancel reply

You must login to add an answer.

Forgot Password?

Need An Account, Sign Up Here

1 Answer

  • Voted
  • Oldest
  • Recent
  • Random
  1. Editorial Team
    Editorial Team
    2026-05-28T02:10:03+00:00Added an answer on May 28, 2026 at 2:10 am
    <%= f.label "Authorized age:" %>
    <%= f.radio_button(:req_driverage, "0") %>
    # and so on ...
    

    The form field helper (radio_button in your case) for model attribute must be called on the form builder object f in order to be properly included in the params hash.

    Check the guide.

    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

I am using rails beta 3 and I have a erb page named index.html.erb
I am new to Ruby, using ruby 1.9.2P180 and Rails 3.1.0.rc2 I have screen.css
Im using Rails 3.0.3 and ruby 1.8.7 I want to render /materials/change_prize.html.erb in materials/change_prize.js.erb
(Using Rails 3.1.3) I have an app that manages products. I import the products
I'm using Rails 2.3.4/Ruby 1.9.1 for my application. In the view I have this
I am currently using rails 3.0.7 and ruby 1.9.2 and making a rails App
using rails 3.0.1 and ruby 1.9.2-p0 in the rails console I'm seeing the following:
im using rails 2.3 and ruby 1.8.7, I have version .0.1.6 of crack vendored
Using rails 3.1, ruby 1.92. I have a bunch of products in a store:
Using Rails 3.0, I have a small bit of code that I seem to

Explore

  • Home
  • Add group
  • Groups page
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Users
  • Help
  • SEARCH

Footer

© 2021 The Archive Base. All Rights Reserved
With Love by The Archive Base

Insert/edit link

Enter the destination URL

Or link to existing content

    No search term specified. Showing recent items. Search or use up and down arrow keys to select an item.