Displaying 20 results from an estimated 100000 matches similar to: "Default select values for time_select"
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_select :datum_1_twrak_van, :order =>[ :hour,
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
2013 Mar 14
0
[Rails 3.2] accepts_nested_attributes_for and time_select
Hi, I am upgrading a Rails application from Rails 3.1.11 to 3.2.12, but
have a problem with ` accepts_nested_attributes_for` in conjunction with
multipart attributes.
The app is used to manage oral 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
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
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
2008 Mar 05
1
Using form fields that arent in database
Basically 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
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
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 =>
2008 Mar 14
1
how do i get country_select and select to show values
Hi i am a newbee at rails and i am using the country_select and select
drop down boxes in my new.rhtml I can make these work fine but when i
try viewing it in my database and show and index they just wont appear,
I have tried to edited it to how do I go about showing these items
everywhere i am completely stuck.
if text field = f.text_field
then why doesnt country_select = f.country_select or
2008 Dec 23
1
Adding to select list
I have several select lists on a form generated via collection_select
pulling values from the database. What I would like to do is, if new
components need to be added to a select list (new options), I am
providing a link beside the select list which will pop-up a small form
to add a new item to the list. Upon saving the new item, I would like
the list on the form (parent window) to refresh, so
2007 Dec 02
4
select and passing some javascript
Hello,
After reading and reading the documentation, I can''t append some
javascript function into a select.
It''s not possible ?
documentation:
-------------------------------------------------------------
select(object, method, choices, options = {}, html_options = {})
some code:
-------------------------------------------------------------
return select(:id, :year, [
2007 Dec 06
8
Default value for country_select
Using Country_select how to have default valur set to United States.
I have a select drop down in my Ui to display the Country names.
But i need United tates to be selected as default value.
I use country_select to populate the country names.
This is how i use <%= f.country_select :country, :selected=>''United
States'' %>
i also tried
<%= f.country_select :country,
2009 Jan 15
2
collection_select not selecting default value
Hi,
I''m trying to create a dropdown using collection_select. However, I cant
seem to get it to select the right option by default.
In my controller I have a setup like this:
@content = Content.new
@content.selection_id = 3
@selections = Selection.find(:all)
In my view I have:
<% form_for :content, @content, :url => { :action => ''create'' } do |f|
%>
2008 Nov 05
4
select in form - best practice?
Q. What resource do readers recommend for referencing regarding best
practices for form construction in Rails?
I have the following situation: location_type of Locations may have one
of five (5) possible codes. Presently I have these codes listed in a
drop-down select constructed thusly:
<p>
<b>Location type</b><br />
<%= f.select :location_type,
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/.
--~--~---------~--~----~------------~-------~--~----~
You
2008 Oct 16
4
Removing values from a select (drop-down) box
Hello,
I am working on a project, and on one form we have a select (drop-
down) box where the user needs to be able to select from a list of
clients. The box is currently being populated with:
<%= collection_select(:client, :id, @account.clients, :id, :name) %>
The problem is that some of these clients may have already been
selected, and we need to remove them from the list. Is this
2008 Jul 14
3
insert select statements from different database
Hello,
i want to insert a select field into my form.
The fields of the select-field should come from a database that is
created in a different modell in the same project.
I donĀ“t need relations simply the content from one field in the table
that should populate the select-field.
How can i do this?
The selected item from the select-field will then be saved amoung other
fields in a second database
2008 Aug 21
4
radio_button_tag - examining the selected value
Hi All
I have four radio buttons created like this
<%= radio_button_tag :answers, 1, false %> a <br/>
<%= radio_button_tag :answers, 2, false %> b <br/>
<%= radio_button_tag :answers, 3, false %> c <br/>
<%= radio_button_tag :answers, 4, false %> d <br/>
And then I have a link_to tag to invoke a controller function
2007 May 24
1
How do I show the selected values in options_for_select? Not as simple as it sounds.
How do I show the selected values in options_for_select? I have a
Service model and a AccessControl model. When a user edits a Service I
want the services access_controls to be pre-selected.
Models:
Service has_many AccessControls
AccessControl belongs_to Service
application.rb:
$types = Array["Athens", "htpasswd", "IP", "None", "Other",
2007 Jan 21
0
select box selected on value ? w option_for_select
I have a select box in my view, with an option for select, a variable
for selected value, and an Ajax observe_field
<select name="most[criteria]" id="most_criteria"
style="display:inline;width:12em;" >
<%= options_for_select({ "most cheerful" => "1", "most beautiful" =>
"2", "most displayed" =>