Displaying 20 results from an estimated 2000 matches similar to: "Multi-parameter assignment"
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 =>
2006 Feb 28
1
Working with date_select ...
I am a little confused about the best way to work with date_select. I see that
in my views it generates a simple input form that allows for the entry of year,
month and date information. If I just leave it at that, great!
But what if now in the controller, I want to work with the date information. I
actually want to take the user input date and compute a new date some number of
days in the
2006 Jul 09
17
Has many / belongs to error with mysql
Hi,
I''ve got stuck with a problem on my rails app - I''ve created a database
for quotes and bookings, with a futher table "eventdetails" (details of
a quote or booking) linked one-one for both tables using a polymorphic
assciation. This all works, but I am now trying to link a quote to a
number of bookings with a has_many and belongs_to (the foreign key is in
the
2006 Apr 08
4
Stack level too deep error :(
Hi,
If anyone has some time to help with my problem that would be really good :)
I am getting a "stack level too deep" error when saving an object to the
database when it is has a has_one relationship to another object I wish
to save and associate after it.
If goes a little like this
class Quote < ActiveRecord::Base
belongs_to :eventdetail
has_many :bookings
# An
2007 Jul 08
2
datetime_select, is creating an instance of the Time class
Hello
It seems that datetime_select, is creating an instance of the Time
class. Why would that be?
I found this while building a site where people can create vigils
(prayer vigils, peace vigils, etc). When I added a validation method
that compared start_date to created_at, it generated the error:
ArgumentError (comparison of Time with DateTime failed):
I was able to put a breakpoint in the
2006 Jun 13
17
reconstituting a date
In my view code, I have <%= datetime_select "in_out", "time_in" %>
which returns in params
:in_out: !map:HashWithIndifferentAccess
time_in(1i): "2006"
time_in(2i): "6"
time_in(3i): "12"
time_in(4i): "20"
time_in(5i): "24"
and I want to save that datetime to a column in the db...
if
2008 Jun 24
10
Question on passing arguments inside a view.
I''m running into an issue undefined local variable or method
`directoryid'' for #<EditorialsController:0x23f1bf8>
I have two Models on a legacy database and only one controller called
editorials with two actions index and display.
I''m trying to pass in a parameter from the results of my search and
getting the above error.
Example:
two tables one is editorial the
2013 Aug 22
1
How do I deal with ActiveRecord::RecordInvalid: Validation failed:
Hello all,
I am currently writing model tests in rails 4. I am attempting to add an
error to a reservation object if the total number of reservations for a
given date and time has reached a pre-determined limit.
When my test runs, it is hitting the appropriate code but it is raising the
following error as opposed to just giving me an error in the object that I
can use.
2012 Oct 12
1
Adding Time when Blanks
Greetings,
My data set has dates and times that I am working with. Some of the times
in Time_of_end are blank. This is supposed to dictate that the particular
experiment lasted 48 hours. I would like to add 48 hours to the start
Start_of_Experiment for another column as End_of_Experiment including both
the ones with 48 added and those with early times. I was thinking
something with a
2006 Apr 20
4
Small Date Formatting Question regarding datetime_select()
Is there a way to make datetime_select() dropdowns work on a 12hr
clock? I need to make a input field that works exactly like the
reminders datetime selecton dropdowns in Backpack to populate a
datetime field in my DB. i.e in the format: month, day, year ? hour
(1-12) minute am/pm. Should I change my database to have a separate
column for date and one for time and use date_select()?
Can
2006 Aug 10
1
Convert datetime_select to Time object?
--------------------------
Question 1
--------------------------
I am dealing with a database that holds products and it has a datetime
field called "active_at". so I have the following for active_at:
<%= f.datetime_select :active_at %>
It gives me 5 different params:
params[:product][:active_at(1i)]
params[:product][:active_at(2i)]
params[:product][:active_at(3i)]
2012 Jun 30
6
Scheduled_task + ad user
Hi,
When a want to use scheduled_task for create a windows task and when i
give a AD user, i have this message :
err: /Stage[main]/Mirnas/Scheduled_task[test]/ensure: change from absent
to present failed: Invalid user: DOMAIN\oper
My user domain and the password are correct.
I have the same error if i change DOMAIN\oper by oper@domain.com
or DOMAIN/oper
With a local user, is working, but i
2007 May 12
4
help, 1 error(s) on assignment of multiparameter attributes
Hi everyone!
I just started learning Ruby on Rails about a week ago for a school
project, and can''t seem to find a solution for something.
I have this inside the form inside of edit_albums.rhtml:
<%= start_form_tag :action=>''proccess_edit_album'', :id=>@album.id %>
....
Release Date: <%= datetime_select(:album, :release_date, :start_year
=> 1960)
2007 May 01
5
duplicate key violates unique constraint
I''ve run into an interesting issue. When setting up a table with data
from a file (I''m doing this in a block). I find that I can''t create
separate entries manually after the import. It complains about a
duplicate primary key. I''ve tried Schedule.id += 1 but id= either
isn''t defined or accessible in the class
Here is my code:
2007 Dec 12
3
datetime_select and Active Record
If I have a form similar to the one below, and ''start'' is a "string"
field in my Database. Is there a way to take all of the date/time
params and put them into ''start'' without too much hacking? I would
like this to be as clean as possible.
<p><label for="start_time">Start Time</label><br/>
<%=
2007 Jul 10
2
Multiple calls to a class method
Hi
Just wrote myself a Date.extract_from_rails_hash to handle parsing
the "date(1i)", "date(2i)" parameters created in the controller
params. I''ve got a method that needs to call this either once or
twice, depending on the contents of the form (one section of the form
is rendered conditionally). So I had two specs for the case where
the second form section
2005 Apr 27
2
noob question: rhtml new/edit views and the date functionality
Hello All,
I''ve been playing with Rails - did the recipe/category sample from
onLamp.com - fairly straight forward - even got it working against
postgres.
Anyway, I''ve been appling rails to a small test project and I can''t
seem to get the syntax down or find a sample of how to use the date
control on a custom new/edit view. The CRUD (is that right?) that
automatically
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 Feb 28
5
Problem with paginate, include and foreign keys
Hi all,
Solaris 10
Ruby 1.8.4
Rails 1.0.0
Postgres 8.1
postgres driver 0.7.1
I''m having a problem with getting paginate() to properly pick up an FK
constraint properly.
I don''t seem to have this issue with ActiveRecord, however. Consider:
create table start_dates (
id bigserial,
start_date date unique,
max_slots int default 40,
primary key (id)
);
create