Displaying 20 results from an estimated 114 matches for "include_blank".
2006 Apr 19
2
select_tag and :include_blank => true not working
Guys,
I''m using select_tag to display a non-model dropdown, which works fine.
However, I''ve tried every which way to use the :include_blank => true
option, but it simply won''t display a blank value. Using :include_blank
=> true with select on model fields works fine.
Can someone please show me a working example?
--
Posted via http://www.ruby-forum.com/.
2006 Feb 21
4
Select error
This code:
<p>
<label for="resource_type">Type</label><br/>
<%= select(:resource, :type, %w{ Web Data }, { :include_blank => true
}) %>
</p>
Produces this error:
TypeError in Resources#new
Showing app/views/resources/_form.rhtml where line #6 raised:
wrong argument type String (expected Module)
Extracted source (around line #6):
3: <legend>Resource General</legend>
4:
5:...
2006 Jul 28
1
Selectbox: display value for :include_blank => true?
Hi all
Is there a way to set a display value for :include_blank => true?
Because an empty <option></option> tag is not valid XHTML 1.1 code
according to Firefox''s Tidy...
Thanks for info. :-)
Joshua
--
Posted via http://www.ruby-forum.com/.
2006 Apr 06
6
select method
The documentation states as an example:
select("post", "person_id", Person.find_all.collect {|p| [ p.name, p.id ] },
{ :include_blank => true }) could become:
<select name="post[person_id]">
<option></option>
<option value="1" selected="selected">David</option>
<option value="2">Sam</option>
<option value="3">Tobias</op...
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/.
2005 Dec 27
0
date_select and :include_blank
Hi,
date_select is a great helper, but I couldn''t find a way to make it display
a text like "Please Select" instead of blank field.
When I use date_select with a param of :include_blank => true, it renders an
option with a value of "" and string of "". I want to display "Please
Select". Anyway to do this? Maybe overwriting ActionView modules would do,
bu since I''m in a process of getting comfy with ruby, I couldn''t figure out
how...
2006 Jul 02
6
remote form w/ evalScripts:true
...=> @list.id%>
<%= hidden_field ''list_item_link'', ''list_item_type'', :value => ''List'' %>
Which list?
<%= select ''list_item_link'', ''list_item_id'', @lists.collect{ |l|
[ l.name, l.id] },
{ :include_blank => true},
{ :class => "formfield", :onchange => "this.form.submit()" }
%>
<%= end_form_tag %>
And here is the code in the template that actually works (using a GET
instead):
Which list?
<%= select ''list_item_link'', ''list_ite...
2006 Jan 04
5
How do I set the default value for date fields?
I want my date fields to default to NIL or "", because the presence of a
date means something. My problem is that rails is defaulting the fields
to today''s date automatically when I create a new record through the
scaffold. I tried removing the default ''0000-00-00'' and changing NOT
NULL to NULL, but both columns get today''s date as the default
2012 Aug 16
6
undefined method `with_indifferent_access' for "":String
...omp, :html => {:id => "new_form", :onsubmit => "return
validate_form()"}, :remote => true do |f|
= f.fields_for :comprobante_emis_regs_attributes do |cer|
= cer.collection_select :reg_fil,
current_contribuyente.contribuyente_regs, :reg_fil, :reg_fil,
{:include_blank => false}, :class => ''reg_fil'', :name =>
"comp[comp_emis_regs_attributes][0][reg_fil]"
Somebody has run into this issue i''m really running out of ideas of how
to fix this.
--
Posted via http://www.ruby-forum.com/.
--
You received this message beca...
Overriding date_select in local project to use custom value rather than blank for starting option...
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 form_options_helper.rb in
gems/actionpack-1.8.1/lib/a...
2009 Sep 02
8
select_month helper
...e 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 a javascript onchange call and I
can''t get it to show up.
Given:
select_month(date, options = {}, html_options = {})
I have:
select_month(0,:include_blank => true, :onchange => "setBirthMMDD" )
I know I''ve gotten html options to work on form fields, but maybe I''m
missing something on how the html_options hash has to be formatted.
I''ve tried:
select_month(0,:include_blank => true, :html_options => {:...
2009 Jan 08
4
Problem with disable_with
...ame'', :size => 30 %></td></tr>
<tr><td style="width:50%;">Project Type:<strong> *</strong></
td><td><%= collection_select ''email'', ''projecttype_id'',
@projecttypes, :id, :name, { :include_blank => true } %></td></tr>
<tr><td style="width:50%;">Region:<strong> *</strong></td><td><%=
collection_select ''email'', ''region_id'', @regions, :id, :name,
{ :include_blank => true } %>&...
2006 Apr 27
4
select item based on previous select list selection?
...my rails newbieness is preventing me from understanding those
completely. Does anyone have complete code or a suggestion as to how to
accomplish this.
This is my existing code:
<%= select (''task'', ''parent_id'', @parents.collect {|p| [ p.title, p.id ]
}, { :include_blank => true }) %>
<%= select (''task'', ''client_id'', @clients.collect {|c| [ c.name, c.id ]
}) %>
Thx
N.
--
Posted via http://www.ruby-forum.com/.
2006 Jun 25
3
select box''s
Hi,
I have this code for a select box,
<%= select("plugin", "plugcats", Plugcats.find_all.collect {|p| [
p.title, p.id ] }, { :include_blank => true }) %>
at the minute it extracts teh requried data, but submits the data as
params[''plugin''][''plugcats'']
how can I get it to submit it as [''plugin''][''plugcat_id'']
thanks
--
Posted via http://www.ruby-forum.co...
2006 May 18
4
Problems using ''select''
...;'';
if !params[:filter].nil? and params[:filter].has_key?(:owner)
@owner = params[:filter][:owner]
end
end
end
Controler:
@users = User.find_all
@filter = Filter.new(params)
View:
select ''filter'', ''owner'', @users.collect {|u| [u.name, u.id]},
{:include_blank => true}
My problem is that when I select some "owner" and submit the form
it does not make current owner selected in combo box.
>From Rails documentation I understood that you had to have
@filter.owner = some_value
to make it selected, but it doesn''t seem to work. Maybe t...
2007 Aug 10
2
Select doenst pass the correct value
Hello,
I have in my view a select tag that doesnt return the right value, could
anyone point me what am I doing wrong?
Heres whats in my view
<%=select "", "situacao", {"Open"=>0,"Closed"=>
1},:include_blank=>true%>
Then in my controller I do this
def status
if request.post?
#Do some stuff
@situacao = params[:situacao]
#some more code
end
end
The problem is that params[:situacao] always returns 0, even when I pick
"Closed"
Any help?
coelho
--
Posted via http...
2006 Mar 06
2
form_tag error -- not found, 404 -- action DOES exist!
...elect(@surveyors, tr.surveyor_id))
%>
</td>
<td>
<%= select_date(
hash2date(tr.visited_on),
:prefix=>"site_visit_helper[timesheet_records][#{i.to_s}][visited_on]",
:include_blank=>true) %>
</td>
<td>
<%= select_time(
hash2time(tr.arrived_at),
:prefix=>"site_visit_helper[timesheet_records][#{i.to_s}][arrived_at]",
:include_blank=&g...
2005 Dec 23
2
Bizarre problems with AJAX / missing variables
...Dublin area [<%= county %>|<%=
rawcode %>]:</label>
<% unless county.nil? %>
<%= select(''contact'', ''town_id'', Town.find(:all, :conditions => [
''county_id = ?'', county ] ).collect {|t| [ t.name, t.id ] }, {
:include_blank => true }) %>
<% else %>
<%= select(''contact'', ''town_id'', Town.find_all.collect {|t| [
t.name + ", Co. " + t.county.name, t.id ] }, { :include_blank => true
}) %>
<% end %>
</div>
and the relevant code for...
2007 Nov 08
3
options_from_collection_for_select
I need to add a blank or dashed field to the
options_from_collection_for_select helper but can''t seem to get it to
work. Tried this, but with no effect:
<%= options_from_collection_for_select @airlines, ''id'', ''name''],
{:include_blank=>true} %>
Anyone know how to do this? Thanks,
-S
--
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 ema...
2007 Jul 31
3
country listbox from table
sorry again,
i''m building a registration form, getting stumped on the country
listbox.
any ideas how i could build a listbox for countries, taking it''s content
from a data table?
i''d imagine i''d have to generate a data model for country, fill it in
with all the current ISO spec countries; that i can do.
then tie that data model to the account controller.