search for: time_select

Displaying 20 results from an estimated 23 matches for "time_select".

2006 Feb 07
9
Is there a good time_select tag helper?
I''m trying to record a list of start and end times, and they''re simply an hour and a minute. Looking at the API, there''s a select_time helper, but that just creates the tag. There''s a datetime_select helper which takes an object and method name, so it does all the magic...but I only want to worry about the hour and the minute. I''ve tried writing my own so far and have not been able to figure anything out. Does anyone have code for a time_select helper that does the magic of filling i...
2007 Nov 14
0
Problem time_select with fields_for
Hi, I''m using fields_for and a time_select but he isn''t saving the time in the db just 00:00:00 All the other fields are fine, but the time_field isn''t working:s This is my code: <% form_for :activity, @activity,:url => {:action => "create"} do |activity_form| %> <td><%= activity_form.time_...
2007 Aug 07
0
Newbie: Want to use time_select to partial fill a datetime field
Hello Our Database schema, and hence Our Model has a few datetime columns/ fields. But when entering new instances, We only want to present time (i.e. HH:MM) in in our HTML views to the user. The time_select looks useful, because it has an attractive minute_select: =>15, so the user can enter 1/4 hours increments. The idea being that we would default the Date part of Datetime attribute to Todays.date, prior to the Save in our Model. The problem is the default RAILS <%Forms %> to Active_recor...
2013 Mar 14
0
[Rails 3.2] accepts_nested_attributes_for and time_select
...exams, so there is a model `Exam`, which has many `Examdate`s. When creating an exam, I can also create the examdates, consisting of a date, a start time and an end time. While the date field is edited using a text field (with a jQuery date picker), the start and end times are selected using a time_select form helper. The examdates are then created using `accepts_nested_attributes_for`: ~~~ {.ruby} class Exam < ActiveRecord::Base has_many :examdates, :dependent => :destroy accepts_nested_attributes_for :examdates, :allow_destroy => true ... end class Examdate < ActiveRecord::Ba...
2007 May 18
0
Default select values for time_select
How can I set the default selected values for the time_select fields? I would like the selected values to bet set at 0 instead of the current time. -- Posted via http://www.ruby-forum.com/. --~--~---------~--~----~------------~-------~--~----~ You received this message because you are subscribed to the Google Groups "Ruby on Rails: Talk" group....
2006 Mar 21
5
Getting a time select input
I''m having trouble workign out which ActionView DateHelpers to display a time input for an ActiveRecord field of type :time. I just want an hours input and a minuites input. I can get these with time_select helper using :field_name and :prefix but it gives both hours and miniutes the same name. <%= select_time(Time.now, :prefix => "search", :field_name => "start_time") %> <select name="search[start_time]"> <!-- hour options --> <select name=...
2005 Dec 01
0
Problem using a date helper
Hi, I''m having trouble getting a date helper working. I was pointed to this by Sean Allen, and it resides at http://theredheadedstepchild.net/articles/2005/08/04/datehelper-fixes It''s meant to fix the bug in Rails which doesn''t allow datetime_select to properly discard the year. So, I''m trying to use the helper''s time_select function. date_helper.rb is in my helpers directory. In my controller, it''s included with "helper :date" In my view, I have the code <%= time_select ''train'', '...
2008 Sep 11
2
time value won't come back from UTC
Hi there, I''m fairly new to RoR, and I seem to be having a problem with :time types. I save my times with a time_select on my form, to a time type field on MySQL. Rails automatically pulls it back to UTC from my timezone (+02:00), but when I display it again, it stays at the UTC value, i.e. I enter in 6:30, and I get 4:30 on my list. Is it just me, or is this a limitation of the time datatype in mysql, obviously a...
2011 Jul 14
0
MultiparameterAssignmentErrors
The attached file show the error I''m getting. I have a time time in my migration and a time_select: <%= f.fields_for :company_layout do |company_layout_form| %> <p> <%= company_layout_form.label ''HorĂ¡rio de abertura'' %> <%= time_select(''company[company_layout_attributes]'', :opening_hours, :ignore_date => true, :minute_step...
2006 Jul 17
2
DB Admin Console
...tegory. This works with working has_many or belongs_to relationships set in Rails. * the edit form automatically created widgets for database columns of type: * :text with optional support for tinyMCE * :string with a text_field * :date with date_select * :time with am/pm via a time_select plugin I heavily modified * :boolean with a checkbox * :file with file_column * :image with file_column and an image display * automatic select boxes for belongs_to * the edit form can be customized (via page_options): * fields can be ignored * the default widget can be changed...
2008 Mar 05
1
Using form fields that arent in database
...asically I need to know how to use forms fields when the attribute name for it doesn''t match a field in my database. I have a form like this. <td><%= date_select ''assessment'', ''ends_at_date'', :value => "Click here..." %> <%= time_select ''assessment'', ''ends_at_time''%></td> My database has a field called ends_at which is a datetime field that should have the combination of these 2 forms fields. However, I dont know how to interact with the values of form fields with ruby in order to do t...
2006 Mar 21
5
Use select_date for my model?
Hi all I have a model "party" that has a time field "starts_at". I have created a form to add new instances of this model. <%= select_date Date.today, :prefix => ''party'' %> Sadly I get the error: NoMethodError in Parties#add undefined method `month='' for #<Party:0x256a600> How can I fix this problem? I remember that I saw in
2006 Mar 12
3
select_time help needed (Noob)
I can''t seem to get a handle on how the select_time helper is supposed to work. I''m a complete noob to rails so bear with me please. I''m trying to add fields to a form to allow for time (hh:mm) selection ie. call received, enroute, etc.. I don''t understand how one maps the form data to the table object and field ie. calls table recieved field.
2007 Jun 22
2
problem with AR and 'virtual' multiparameter attributes.
Hello, I have a model which I would like to have a ''virtual'' date column. This column wouldn''t exist in the database, but would exist for validation, etc. The data would be provided in the form of a date_select in the view. This produces a multiparameter attribute. My problem is that the ''execute_callstack_for_multiparameter_attributes'' method in
2005 Dec 23
6
Selecting time
...#39;'s going to be used to keep track of the amount of time spend on customers of the company I work for. This mainly consists of object with a begin time, an end time and a calculation of the difference between those timestamps (actual time spend on the job). I made a small form with a datetime_select helper for the begin and end time (the column type inside the DB is also dateselect). Because the actual time spend on the job can be less then the difference between begin and end I want this time to be selectable too. Because this attribute only holds hours and minutes I tried to use the sele...
2006 May 27
10
Displaying Hours
Here''s an intersting one: I have a client who wants to store hours of operation of a business for their RoR web app. I came up with a solution, but I really don''t like it. I have a MySQL table that has these fields monday_start, monday_end, tuesday_start, tuesday_end, etc., all as time fields. That''s all find and dandy. The kicker is, the client wants the hours to
2006 Jan 29
0
Active Record and Time support
Anyone know why ActiveRecord and the associated helpers is lacking in Time support? I have 2 time fields in my table. I have to manually handle their input and storage instead of using any helpers, which don''t exist. Just curious as to why something like time_select doesn''t exist. Bob Silva http://www.railtie.net/ -------------- next part -------------- An HTML attachment was scrubbed... URL: http://wrath.rubyonrails.org/pipermail/rails/attachments/20060129/8c8a6063/attachment.html
2008 Mar 05
1
How to use values through forms
Basically I need to know how to use forms fields when the name for it doesn''t match a field in my database. I have a form like this. <td><%= date_select ''assessment'', ''ends_at_date'', :value => "Click here..." %> <%= time_select ''assessment'', ''ends_at_time''%></td> My database has a field called ends_at which is a datetime field that should have the combination of these 2 forms fields. However, I dont know how to interact with the values of form fields with ruby in order to do t...
2008 Oct 15
0
Combine date and time in mysql
I have a date from a calendar_date_select and a time from a time_select. They go to a date field and a time field in mysql. How do I combine time and date on both sides to make a comparison in a find? I think this is on the right path, right? DATE_ADD(start_date, INTERVAL start_time HOUR_SECOND) -- Posted via http://www.ruby-forum.com/. --~--~---------~--~----~----...
2007 Nov 02
1
1 error(s) on assignment of multiparameter attributes - Very Strange
Hello... Well, I post this one without too much hope that someone will be able to give me an answer, because it is strange. I have a time select field, the field on the database is of type time only. When creating a document, as long as the time is not greater than 14:00, then it saves as 00:00, but if the time is greater than 14:00 and less than 22:00 then it throws this error: 1 error(s) on