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 8852343
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 14, 20262026-06-14T13:22:32+00:00 2026-06-14T13:22:32+00:00

Firstly im new to Ruby and this could possibly be the wrong approach, however…

  • 0

Firstly im new to Ruby and this could possibly be the wrong approach, however…

I’m trying to set two values in my select, using simple form. So far i have:

<%= f.input :rsvp, :collection => [:attending, :not_attending], :prompt => 'Choose one...' %>

This works fine, i can load the page, choose a selection. Now RSVP is a field in my db:

reply DB

class CreateReplies < ActiveRecord::Migration
  def change
    create_table :replies do |t|
      t.string :name
      t.text :menu
      t.integer :rsvp

      t.timestamps
    end
  end
end

reply.rb

class Reply < ActiveRecord::Base
  attr_accessible :menu, :name, :rsvp, :user_id
  belongs_to :user
end

My thinking was changing rsvp from :string where i have to type attending / not attending to an :integer so that i could yes likea true / false value on the two choices. Now like i said i’m very new to this, but in my head, this might be how to go about such a thing.

Because im going to try and get a count of how many are attending / not attending and display on the index. Sorry if anything is missing, let me know and ill update the question.

  • 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-06-14T13:22:34+00:00Added an answer on June 14, 2026 at 1:22 pm

    I think you went on the right way. You can make a group radio button for user select, try:

    <%= f.input :rsvp, :collection => [['Attending',1], ['Not Attending',0]], as: :radio_buttons, label_method: first, value_method: last, :prompt => 'Choose one...' %>
    

    Or this way:

    <%= f.collection_radio_buttons :rsvp, [[true, 'Attending'] ,[false, 'Not Attending']], :first, :last %>
    
    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

Firstly I am new to android and Java so this is a beginners question.
Firstly, I should say I'm completely new to Pylons, trying to learn web development
Firstly, this is a homework assignment, and I am very new to programming in
Firstly, I'm new to Clojure, so this is likely to be stupid question. As
I am very new to Ruby, and programming in general. Firstly, I have the
Firstly I'm very new to web development so forgive me if this is a
Firstly, I'm new to Android (so I apologize if this question is ignorant) but
Firstly, appologies if i get any terminology wrong on the upcoming post, this is
Firstly, I am new to both android and Java. I have two classes, my
Firstly, I'm new to MVC - and trying out ASP.NET MVC3. I want 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.