Displaying 20 results from an estimated 30000 matches similar to: "adding id and class to date select helper.. is it possible ?"
2006 Jul 26
8
change text_field_tag class
in my booking / _form I have the following input fields : (startdate and
endate)
<div>
<label for="startdate">Booking Start Date</label><br />
<%= text_field_tag(''startdate'', @startdate, {:class => @startdateclass,
:readonly => "readonly", :maxlength => "25"} ) %>
<%= observe_field("startdate",
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 Oct 29
1
:with for observe_field helper--parameter passing
I am trying to write a :with hash for the observe_field helper watching
a select which was built by select_month--it contains all of the months.
The current :with that I have, which works, is:
:with => "month"
,which passes the updated month in the select through params[:month].
However, I need to pass the current year through params[:year], which
does not change when the month
2006 Jun 17
2
problem with select_date
In my form I have these items:
<%= select_year Date.today,
:start_year => Schoolyear.get_startdate.year,
:end_year => Schoolyear.get_enddate.year %>
<%= select_month Date.today.month %>
No matter what I do, in my controller I can''t seem to access the
selected year and
month.
I have tried params[:month].to_s and also
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" =>
2010 Jul 26
1
form date helper with text year
I have a date where the year range is more then I want to define in a
select_date scaffold generated year range.
My idea was to have the year entered as a text field and the month and
day using something like:
<%= select_month @person.born,:prefix => :person ,:field_name =>
"born(2i)" %>
<%= select_day @person.born,:prefix => :person , :field_name =>
2006 Jul 26
0
render :update do | page | to modify a css class string...
In my booking/_form.rhtml, I have 2 <input text fields>
startingdate (selction from unobstrusive calendar ) and endingdate
<div>
<label for="startdate">Booking Start Date</label><br />
<%= text_field_tag(''startdate'', @startdate, {:class =>
@startdateclass, :readonly => "readonly", :maxlength => "25"}
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.
2009 Feb 26
8
beginners question
hi group,
I am making a little rails app to experiment with rails. It consists
of one model, item, that represents an item on a todo list.
A todo item has a description, a state (finished or not) and a due
date.
After changing the scaffold screens a bit, I wanted to be able to
have no due date. I tried to do this by making a radio button; if ''no
date'' is selected, the date
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)
2006 Jan 16
0
Specifying Javascript events for form fields
So forgive the stupid question, I''m a relative Rails newby. I have a form
that I would like to submit each time the user changes their selection in
one of several select items (single selection only).
I''ve got this behavior working properly in the select_tag method, but I also
have two other fields on the form - a month and a year. The month and year
tags are created using the
2006 Aug 13
1
select include_blank true
Is there any way to display a default message value ''Select'' rather tha
an empty value when using this option ?
kad
--
Posted via http://www.ruby-forum.com/.
2009 Sep 02
8
select_month helper
I''m trying to rewrite a fusebox-like application (Active4D plugin to
4D database) in RoR/postgres and I''m doing okay - but keep running
into things that stump me. It seems like it takes me hours to figure
out something that I could have written in pure code in minutes.
The select_month and select_day helper has been my latest waste of
time. All I''m trying to do is add
2009 Jan 28
1
How to give onchange for select_year rails helper....
<%=select_year(Date.today,:include_blank=>true, :start_year =>
Date.today.strftime("%Y").to_i, :end_year => 1999)%>
i am using rhis helper... now i want to give onchange here....
Please help me to solve this ....
thanks in advance
JK
--
Posted via http://www.ruby-forum.com/.
--~--~---------~--~----~------------~-------~--~----~
You received this message because
2007 Jun 26
3
what is the :or parameter in a submit_tag ?
I read the following tag in teh Beast example
<%= submit_tag''Login'', :or => link_to_function(''forgotten password'',
"$(''reset-password'').toggle();") %>
I understand the link_to_function, but what is this :or parameter used
for ?
the link doesn''t appear, so it cannot be used...
thanks for your lights
kad
--
2006 Oct 14
2
sending parameters with link_to_remote Ajax Request
In a panel, I have an hidden input field which is modified by a
javascript function (from calendar)
how can I sent the value of this input field in my link_to_remote call ?
presently I just send back one parameter (an id) but I need both...
<input type="hidden" name="booking[start_at]" id="f_date_s"
value="booking[start_at]" />
...
<%=
2007 Jan 20
2
find_by_sql with named parameterized sql
I tried to use named parameters in my SQL query , using find_by_sql
Order.find_by_sql ([select * from orders where amount > ? and quantity >
?", [ @amount, @quantity ] works;..
but
Order.find_by_sql ([select * from orders where amount > :amount and
quantity > :quantity ", [ :amount => @amt, :quantity => @qty ] is not
working
a I wrong or should I use a plain select
2007 Jun 12
3
REST Routing issue
If I use http://0.0.0.0:3000/users/25/messages/new
I can create a new message ressource for user 25 that''s OK....
I would like to be able to use such url :
http://0.0.0.0:3000/users/25/messages;send?to=5
in order to create a new message from user 25 for a specific receiver
how should write my route ? I tried....
map.resources :users do |users|
users.resources :messages,
2007 Dec 22
8
Rails 2.0 rescue_from
I am trying to use the new Rails 2.0 macro : rescue_from
class PostsController < ApplicationController
rescue_from ActiveRecord::RecordNotFound, :with => :deny_access
...
def show
@post = Post.find_by_id(params[:id])
raise ActiveRecord::RecordNotFound if @post.nil? #illegal access
.....
end
def deny_access
respond_to do |format|
format.html
end
end
but the
2007 Jun 30
2
REST Route how to avoid hacking routes
what''s the best protection against someone trying to modify an URL in a
named route
/users/25/posts
if the user enter another URL /users/26/posts, he can get acces to user
26 posts unless ..
a before_filter is checking the current_user ID
but is there any other way to do it ?
thanks for your lights
kad
--
Posted via http://www.ruby-forum.com/.