Displaying 20 results from an estimated 120 matches similar to: "[Rails 3.2] accepts_nested_attributes_for and 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
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.
To post to this group, send email to
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
2011 Jul 16
0
nested_form gem don't work for accepts_nested_attributes_for :limit
Hello, I have the next:
class Post < ActiveRecord::Base
has_many :image, :dependent => :destroy
accepts_nested_attributes_for :image, :allow_destroy => true, :limit
=> 4
end
class Image < ActiveRecord::Base
belongs_to :Post
... paperclip settings ...
end
And the form view for the post is:
<%= nested_form_for @post, :html => { :multipart => true } do |f| %>
2010 Mar 09
0
undefined method `accepts_nested_attributes_for' for #<Class:
Sorry for the newb question,
but it is: going through first steps I fond this exception.
Have no idea, my rails version is 2.3.5
--
You received this message because you are subscribed to the Google Groups "Ruby on Rails: Talk" group.
To post to this group, send email to rubyonrails-talk-/JYPxA39Uh5TLH3MbocFF+G/Ez6ZCGd0@public.gmane.org
To unsubscribe from this group, send email to
2012 Aug 25
0
accepts_nested_attributes_for and fields_for not working!
I want to be able to create one menu object that has fields_for :brunch,
:lunch, and :dinner. The menu object has_many brunches, lunches, and
dinners, but each time I "edit", only one brunch, one lunch, and one dinner
object are added. I''m using carrierwave to upload brunch_menus,
lunch_menus, and dinner_menus (attributes of brunches, lunches, and dinners
respectively) as
2009 Jul 08
0
accepts_nested_attributes_for and has_one
Hi all, I''m seeing some unexpected behaviour in a nested model and I''m
not sure if it''s a bug or if I''m doing something wrong. When
assigning nested attributes, the associated object gets replaced with
a new record.
Example code:
class Car < ActiveRecord::Base
belongs_to :driver
end
class Car < ActiveRecord::Base
belongs_to :driver
end
2011 Sep 27
0
accepts_nested_attributes_for is not working for uniqueness
class User < ActiveRecord::Base
accepts_nested_attributes_for :emails, :allow_destroy => true,
:reject_if => proc { |attributes| attributes[''address''].blank? }
end
class Email < ActiveRecord::Base
belongs_to :user
validates_presence_of :address
validates_email_format_of :address
validates_uniqueness_of :address,
2010 Feb 25
1
accepts_nested_attributes_for vs. multiple controllers on one page
Hi,
I''d like to render the results from show, create, edit and delete
actions for several different models (one controller per model) on one
page.
While these several models are conceptually related, they do not need
to be associated with each other. So, I''d rather not impose
associations on them just to use accepts_nested_attributes_for to
facilitate their presentation in a
2009 Jun 24
1
accepts_nested_attributes_for :reject_if issue
I have the following models:
class Order < ActiveRecord::Base
belongs_to :billing_address
belongs_to :shipping_address
accepts_nested_attributes_for :billing_address
accepts_nested_attributes_for :shipping_address, :reject_if => proc {
|attributes| attributes[''has_shipping_address''] != ''1'' }
def after_initialize
self.build_billing_address
2009 Jul 28
0
'double' nest form fields with accepts_nested_attributes_for
Hi
Is it possible to ''double'' nest form fields with
accepts_nested_attributes_for?
Something like:
[code=ruby]<% form_for parent do |parent_form| %>
<% parent_form.fields_for parent_children do |parent_children_fields|
%>
...
<% parent_children_fields.fields_for parent_child_activities do
| parent_child_activities_fields| %>
2011 Apr 07
0
accepts_nested_attributes_for, validations, :inverse_of option on associations, and IdentityMap
This feels more like a question to ask the core list, forgive me if I trespass.
I''ve been trying to help one of my cow orkers get through a sticky
problem. He''s got a fairly complex nested form to update a model and
its children. He''s started adding some validations, and we''ve
encountered a number of issues:
First he had a validation on one of the child
2010 Feb 06
1
accepts_nested_attributes_for with has_many => :through
I have two models, links and tags, associated through a 3rd model,
link_tags. I added the following to my link model,
has_many :tags, :through => :link_tags
has_many :link_tags
accepts_nested_attributes_for :tags, :allow_destroy => :false,
:reject_if => proc { |attrs| attrs.all? { |k, v| v.blank? } }
and put this in a partial called by the new and edit forms for links,
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 =>
2013 Nov 10
3
accepts_nested_attributes_for how, example
I have following tables with following models:
users(id, role_id) *has_many :entries*
categories(id, category_name) *has_many :entries*
entries(id, category_id, user_id) *belongs_to :user, belongs_to
:category, has_one :storage*
storages(id, title, content, entry_id)* belongs_to :entry*, *has_one
:vote*
votes(id, count, storage_id) *belongs_to :storage*
Now,
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
2010 Nov 28
6
has_one accepts_nested_attributes_for fields_for NOT WORKING HELP
MODEL
class User < ActiveRecord::Base
has_one :address, :dependent => :destroy
accepts_nested_attributes_for :address
end
CONTROL
def new
@user = User.new
@user.build_address # Adicionei
...
VIEW partial _form
....
<% f.fields_for :address do |b| %> # Adicionei
<%= b.text_field :city_manual %> # Adicionei
<% end %>
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
2010 Jan 26
2
accepts_nested_attributes_for :has_many :through => 'bug?'
Hey guys & ladies!
I''ve got the following relationship which i''m trying to get
accepts_nested_attributes to work with. But when i submit my form, it
looks as if its expecting a Company object, rather than an array of
companies. which really doesn''t make sense considering its a
has_many :relationship.
So what i''m after, is a way to