similar to: Auto-populating time portion of a datetime field from a form

Displaying 20 results from an estimated 400 matches similar to: "Auto-populating time portion of a datetime field from a form"

2005 May 08
3
Overriding date_select in local project to use custom value rather than blank for starting option...
I would like to have a date control on a page and I would like a behavior similar to what you get using date_select with the :include_blank => true option where the first value in the dropdown is "- Month -", "- Day -", or "- Year -" rather than a blank value for the respective month, day, and year select fields. I took a look at the ruby source for
2006 Jul 06
3
Understanding date_select naming conventions
I am using the date_select helper to generate date select elements in a form. I notice that the generated HTML shows that these selects have the following names: Month: current_job[StartDate(2i)] Day: current_job[StartDate(3i)] Year: current_job[StartDate(1i)] I''m assuming that the Xi identifiers somehow specify the appropriate date part from a date or time value. Can anyone
2006 Jul 06
4
ERb question: Embedding <%= %> in helper method calls
I had a situation where I wanted to use a <%= %> (scriptlet) in my text_field call to set the "disabled" attribute on the text field, like so: <%= text_field(:current_job, ''removeLinkPos'', :value => '''', :id => ''offset'', :maxlength => 2, :disabled => <%= sometest ? ''true'' :
2008 Jul 04
4
Routing and Parameters
Greetings. I have a route something like this: map.calendar ''/tasks/:year/:month'', :controller => ''tasks'', :action => ''calendar'', :year => /\d{4}/, :month => /\d{2}/ (Ignore the obvious problems of invalid data.) I''m trying to create a form that will allow my users to navigate from one month/year to the next.
2008 Mar 19
5
object_transactions plugin w/2.x disables AR session store
All, Win XP Rails 2.0.2 object_transactions plugin (http://code.bitsweat.net/svn/object_transactions/) transaction-simple gem 1.4 (required by object_transactions plugin) AR SQL Server Adapter 1.0 SQL Server 2000 Using the object_transactions plugin with Rails 2.0.2 (and I assume based on what I''m seeing that this goes for Rails 2.x) disables the ability to save to an ActiveRecord based
2005 Dec 12
1
Search screens with dates
Tried googling and searching the lists for this. I''d like to do a search on some dates and naturally enough use the date helpers. I have a number of problems: -- datetime_select wants an active record model -- select_datetime does not take the options that datetime_select take - specifically :order that leaves me with something like <label>Date/Time
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 Jul 11
4
checkboxes with a has_many :through relation
All, I''m populating a view with checkboxes in a list. I want to be able to assign to my has_many relationship using the post values of these checkboxes. Essentially, I want to populate the relationship table which will create the correct join values in my model. Here is my check_box_tag code: <%= check_box_tag("@current_job[target_list_ids][]",
2006 Jul 26
2
text_field and date_select in collection
hello, i would like to display a collection of records on one page (e.g. an author record with all his/her books). a record contains a text_area (e.g. a description of the book) and a date_select (e.g. when the book was published). <% for @book in @author.books %> <%= text_area ''book[]'', ''note'' %> <%= datetime_select
2008 Jun 09
3
Rails 2.1 and ddatetime_select
I''ve updated to 2.1 and am continuing to have issues with datetime_select helpers which worked fine previously. Example: <% form_remote_tag(:url => { :controller => ''notes'', :action => :add_booking_note_ajax, :id => @booking},
2006 Jul 05
3
PLUGIN newbie: How do I use an installed plugin
All, I''ve downloaded and installed a plugin into my vendor directory. How do I then take advantage of it? It has an init.rb file which has the appropriate require. What do I need to do to make sure that the plugin code gets loaded? Thanks, Wes -- Posted via http://www.ruby-forum.com/.
2006 Mar 10
14
Oracle Date type errors rails on edit
I have a table with "expires_on" a DATE field. "Show" and "Destroy" work, but "Edit" errors: /usr/local/lib/ruby/gems/1.8/gems/actionpack-1.11.2/lib/action_view/helpers/date_helper.rb:150:in `select_hour'' /usr/local/lib/ruby/gems/1.8/gems/actionpack-1.11.2/lib/action_view/helpers/date_helper.rb:149:in `select_hour'' It only happens when
2006 Jul 16
1
form helpers with non-ActiveRecord objects
I have an ActiveRecord model (called Festival) that contains an array of "FestDate" objects serialized into a sql text column of the Festival object. (like the Agile book first edition describes on p. 205) The FestDate objects themselvs are not ActiveRecord objects. (of course, otherwise they would be in their own table...) When working with a Festival, I would like to use various
2011 Feb 03
3
2.6.2 excluding an exported resource
I have the class below to export host entries. However I wish to override the entry for my host to 127.0.0.1 So for all of the hosts other than foo.bar.com I would like them to have the real IP address but for foo.bar.com I would like to just have the loopback host entry. 2.6.2 doesn''t allow multiple tags and if I put in another entry for localhost there is a collision. Is there any
2006 Jun 13
1
How to give conditions in rails
Hi, I have Holiday table. the fileds are id,holiday_date,description. i added new records and list them also. when i listed all the records in the database are listed but i want to list only one particular year records. my holiday_list.rhtml page is as follows <%= stylesheet_link_tag "common", :media => "all" %> <%= error_messages_for ''holiday''
2011 Nov 10
1
Auto populate text_fields based on selected item from another collection_select
Hello people I''m trying to figured this out, but I still can''t do it. I have a rails 3 app, I''m working with invoices and payments. In the form for payments I have a collection_select where I display all the invoices number (extracted from a postgres database), and what I''m trying to do is when i select an invoice autopopulate others text_fields (provider,
2006 Jun 07
2
date select box''s
Hi I have the following date select box <%= date_select ''min'', ''min'' %> When you submit a date, it re-loads the page with the same date select box, but displays todays date, no matter what you submitted before. How can I get it to re load with the submitted date. Thanks Scott -- Posted via http://www.ruby-forum.com/.
2006 Jul 14
7
Form validation - keepin correct fields displayed on refresh
All, I''m finally doing my first real form in Rails - the model object that I''m entering information for has 8 validations so far. If I type in good values for all the fields but one, I get the pretty validation, and the nice field highlighting, but all of the fields are cleared, forcing me to retype all of that info. That is a big drag. Is there a standard way to get the
2006 Jun 16
3
finding out about options
I''ve been to the RoR api docs trying to find out about options for various methods (mostly for select helper methods), yet I find no listing of options even when the method described says that it takes options. How can I find out what are valid options say for a date_select tag? Thanks, Dave
2006 Feb 05
0
How can i specify default time to datetime_select tag
I want to specify a different default time to datetime_select tag how can i do that. also i was looking at rails helper code ----------------------------------------------------------------------- module ActionView module Helpers module DateHelper def to_datetime_select_tag(options = {}) defaults = { :discard_type => true } options = defaults.merge(options)