Displaying 20 results from an estimated 5000 matches similar to: "radio_button groups"
2006 Jul 06
0
radio_button with boolean fields does not work with postgresql
I don''t know what I am doing wrong. I have a User class with a
"send_message_emails" boolean field. The value for this is true. In
postgresql this is stored as a "t" in the database. In Rails this field is a
boolean and is set to true, but for some reason the following code is *not*
working... the radio_button is not selected.
<%= radio_button "user",
2006 May 31
2
Storing a NULL value from a radio_button
Hi, I''ve a boolean database field (tinyint(1)) wich allows nulls.
Then, I''ve something like this:
radio_button(''server'',''customer_has_login'',"NULL")
radio_button(''server'',''customer_has_login'',true)
radio_button(''server'',''customer_has_login'',false)
The problem is
2006 Apr 04
0
radio_button in a loop not working
Hi!
I''m a RoR newbie and i''m trying to make this sample code work...
I must be able to choose whether or not to switch lights on/off (one
light per line)
<table>
<% @valeurs.each do |@v| %>
<tr>
<td>Light <%= Light.find(@v.light_id).nom %>:</td>
<td><%= radio_button(''v[]'', ''etat'',
2006 Jul 01
4
Radio_button in loop problem
Hi all, I can''t figure out why my radio_buttons won''t reflect the values
stored in my database. I read through some of the previous posts -- is
it true that they don''t work with integers?
This is the code I''m using:
<% for question in @survey.questions %>
<%= debug question %>
<%= radio_button ( "question", :question_id,
2006 Apr 06
1
Puzzled by "radio_button".
I have what seems like simple, working code:
<form action="save_dh_options" method="post">
<fieldset>
<legend>DH Work Reports</legend>
<p>Would you like to fill a work report?</p>
<p><%= radio_button("user", "enable_report", "yes") %><label
for="yes"> Yes</label><br
2010 May 19
1
Cannot have both select and radio_button together on the same form
Hello, I''m new to Ruby on Rails.
I am creating a form for searching purpose:
<% form_for :src_cond,
:url => {:action =>''search''} do |p| %>
<%= p.radio_button("bd", "1") %> a
<%= p.radio_button("bd", "2") %> b
<%= p.select :bd2, %w[1 2 3 4],{},{:index=>nil} %>
<%=
2005 Mar 07
2
radio_button helper and "checked" option
Does anyone know how to get the radio_button helper to set the html
"checked" option?
Thanks,
Curt
2006 Jan 04
4
radio_button method does not recognize int values?
So the api listing says that radio_button(object, method, tag_value,
options = {}) gives a radio button tag, and if object.method ==
tag_value, then the button will be checked.
I verified the method behaves correctly for attributes of type string.
However, if the attribute is of type int, it doesn''t make the button
checked.
Does anyone have some information before I file a bug?
Some
2006 Aug 22
0
Re: Problem with find condition and habtm relationship.
OK. This may help, but it will also make your head hurt. The basic
problem that you''re running into is that you want a "for all"
operator and sql doesn''t have one. Instead, you have to think of the
query in terms of the logically equivalent "not exists not".
Effectively, a proposition is true for all x if you can''t find a
counter-example in
2006 Aug 04
2
observe_field for radio_button
Hi,
I need to observe a set of radio buttons but am having great trouble. My
observe_field looks like this:
<%= observe_field :user_select, :frequency => 0, :url => { :action =>
:admin_control } %>
Now it works fine if I use a text_field like this:
<%= text_field :user, :select, "size" => 20, "maxlength" => 16 %>
But I want a radio button, and
2006 Apr 04
1
using form_remote_tag and radio_button
I want the user to select a date using radio buttons. The following
code shows the last 7 days.
<%= form_remote_tag(:update => ''register_order'',
:url => { :action => :register_orders } ) %>
<% 1.upto(7) do |i| %>
<%= radio_button "date", "register_date", i.days.ago.strftime("%Y-%m-%d") %>
2011 Aug 09
4
Nesting select and text_field in radio_button
I''m creating my first Rails app and need an idea creating forms.
I have Meeting model with place attribute.
I want to have two fields for Meeting.place = one would be select with
places from other meetings or text_field if the place is being used
first time. User would be selecting radio_button of which field he has
used.
So is there any way to nest select and text_field within 2
2006 Mar 14
3
Help doing find - look for nonempty habtm
I''ve got a Cuisine and a Restaurant model, with a habtm. One thing I
want to do is find all the cuisines that have at least one restaurant
associated with them. Right now I''m using the following SQL query:
SELECT DISTINCT(cuisines.*) FROM cuisines, restaurants,
cuisines_restaurants WHERE cuisines.id =
cuisines_restaurants.cuisine_id AND restaurants.id =
2006 May 03
0
Newbie Help
Is it my environment? Is something wrong, cause I thought this should
just work?
I have a simple table and I created a model and a controller:
ruby script/generate controller Restaurant
ruby script/generate model Restaurant
I edited the controller to this:
class RestaurantController < ApplicationController
scaffold :Restaurant
end
I run it and:
http://0.0.0.0:3000/Restaurant works
2013 May 09
0
Replace rows in dataframe based on values in other columns
Hi,
dat1<- read.table(text="
Restaurant owner purchase_date
??????????? 23 Chuck 3/4/2011
??????????? 23 Chuck 3/4/2011
??????????? 23 Chuck 3/4/2011
??????????? 23 Chuck 3/4/2011
??????????? 23 Bob??????? 1/1/2013
??????????? 23 Bob??????? 1/1/2013
??????????? 23 Bob???????? 1/1/2013
??????????? 15 Hazel 4/11/2010
??????????? 15 Hazel 4/11/2010
??????????? 15 Hazel 4/11/2010
???????????
2006 May 01
0
PostGIS and MySql Spatial Extensions in Rails
Hello,
This post is to announce a new release of the Spatial Adapter for Rails,
which is a plugin that adds support for columns of geometric types (point,
linestring, polygon,etc...) to ActiveRecord. Currently the only supported
databases are MySql and PostGIS.
With this release, geometric columns should behave like columns of any other
basic types in all areas: migration, data access, dumping
2006 May 04
9
Help: wrong number of arguments (0 for 1)
Is it my environment? Is something wrong, cause I thought this should
just work?
I have a simple table and I created a model and a controller:
ruby script/generate controller Restaurant
ruby script/generate model Restaurant
I edited the controller to this:
class RestaurantController < ApplicationController
scaffold :Restaurant
end
I run it and:
http://0.0.0.0:3000/Restaurant works fine,
2006 Mar 22
1
How do you clean up this cryptic code?
So, I''m coding my school project in Rails.
There are two models, User and Restaurants.
I noticed that in Restaurants, when you use the belongs_to method, you
could specify the condition of the associated table. There are a few
types of users, in the user_type column of the users table - owners is
type 1, users are type 2.
So in my haste to hand in enough code, in the Restaurant model,
2006 Jul 09
1
Quick Question
I have this method in a controller
def sort_by_cuisine
#@restaurants = Restaurant.find(:all, :conditions => ["cuisine_id =
:id", params], :order => params[:sort])
@cuisines = Cuisine.find_all
end
And I want to put the bulk of it in the model, but still call it from
the controller. How can I do this? I''m fairly new to Ruby on Rails and
I''ve tried
2006 Jul 31
9
Multiple Pagination
I have the following:
def index
begin
@restaurant_pages, @restaurants = paginate :restaurants,
:order => (params[
:sort ] || "name"),
:per_page => 2
@cuisines = Cuisine.find_all
rescue
redirect_to :action => :index
end
end
# sort by cuisine
def