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

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 26, 20262026-05-26T09:18:55+00:00 2026-05-26T09:18:55+00:00

I have following Model t.string name t.date start_at t.date end_at t.datetime created_at t.datetime updated_at

  • 0

I have following Model

 t.string   "name"
 t.date     "start_at"
 t.date     "end_at"
 t.datetime "created_at"
 t.datetime "updated_at"
 t.string   "trainer_id"
 t.string   "venue_id"
 t.string   "description"
 t.boolean  "holy"
 t.integer  "nxt"
 t.string   "country_id"
 t.string   "status"

Hear status can be either “1” or “0” in my form I loaded it through dropdown list as follows

enter code here
<%remote_form_for @event, :url => {:controller => 'events', :action => 'update'}  do |f| %>
  <p>
   <%= f.label :name %><br />
   <%= f.text_field :name %>
  </p>
  <p>
   <%= f.label :start_at %><br />
   <%= calendar_date_select_tag "event[start_at]", "", :valid_date_check => "date.getDay() != 0 && date.getDay() != 6 && date.stripTime() > (new Date()).stripTime() ", :value=> @event["start_at"] %>
  </p>
  <p>
   <%= f.label :end_at %><br />
   <%= calendar_date_select_tag "event[end_at]", "", :valid_date_check => "date.getDay() != 0 && date.getDay() != 6 && date.stripTime() > (new Date()).stripTime()", :value=> @event["end_at"] %>
  </p>
  <p>
   <%= f.label :trainer_id %><br />
       <%= collection_select("event", "trainer_id", @trainers , :id, :name, {:prompt => 'Select a Trainer'})%>
  </p>  
  <p>
   <%= f.label :country_id %><br />
       <%= collection_select("event", "country_id", @countries , :id, :name, {:prompt => true}, :id => 'xx') %>
       <%= observe_field('xx', :url => { :controller => 'countries', :action => 'update_city_menu' },
              :update => 'city_field_div',
      :with => "'myval=' + escape(value)") 
      %>
       <div id="city_field_div">
       <%= collection_select("event", "venue_id", Venue.find(:all,:conditions=> [ "country_id = ?", (session[:CountID]).to_s]) , :id, :place, {:prompt => true}) %>
       </div>
  <p>
       <%= f.label :status %><br/>
       <select id="status">
       <option value="0"<%= session[:status] == 1 ? ' selected="selected"' : '' %>>Completed</option>
       <option value="1"<%= session[:status] == 0 ? ' selected="selected"' : '' %>>Not Completed</option>
       </select>
  </p>  
  <p>
   <%= f.submit 'Update' %>
  </p>       
<% end %>

All the data can view correctly but problem is when I try to update status it doesn’t update status field[All others are updated perfectly]. Please can someone explain the error on this ? Even it doesn’t through error message.

  • 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-26T09:18:56+00:00Added an answer on May 26, 2026 at 9:18 am

    I found the answer we can use select status as this

        <%= select( "event", "status", { "Completed" => "1", "Not Completed" => "0"}) %>
    

    This will do all things correctly. 🙂

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

Sidebar

Related Questions

I have Event model which contains following fields string name date start_at date end_at
I have my model field decorated in the following way: [DataType(DataType.Date)] [Display(Name = Date
I have the following model class (simplified) class A{ private String name; private List<B>
I have the following Model: public class Person { public string Name {get;set;} public
I have the following model: public class Person { public string Name { get;
I have the following tables Pedal Brand:string Classification:string Model:string Variety Title:string name:string pedal_id:integer Example
I have the following Model: public class DeliveryTracking { public string TrackingRef { get;
So I have the following model: public class Person { public String FirstName {
I have the following model structure: class Container(models.Model): pass class Generic(models.Model): name = models.CharacterField(unique=True)
I have the following model and instance: class Bashable(models.Model): name = models.CharField(max_length=100) >>> foo

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.