Displaying 20 results from an estimated 2000 matches similar to: "Getting an array of ids from form checkboxes?"
2006 Jul 11
4
checkboxes with a has_many :through relation
All,
I''m populating a view with checkboxes in a list. I want to be able to
assign to my has_many relationship using the post values of these
checkboxes. Essentially, I want to populate the relationship table
which will create the correct join values in my model.
Here is my check_box_tag code:
<%= check_box_tag("@current_job[target_list_ids][]",
2013 May 27
3
Ransack, acts-as-taggable-on and checkboxes in search form
need some help on ransack filtering.
I have model Project, which has many tags through acts_as_taggable gem.
Project.rb:
class Project < ActiveRecord::Base
include PublicActivity::Common
belongs_to :customer
belongs_to :category
has_many :attachments, :as => :attachable
has_many :reports, :dependent => :destroy
has_many :messages, :dependent
2011 May 30
5
rails habtm checkboxes with jquerymobile
Hi guys, I have a habtm association working properly. My application
consists of both a desktop and a mobile version.
My mobile version is made with jquerymobile and I would like my checkboxes
in the edit form to look like the checkboxes shown in
http://jquerymobile.com/demos/1.0a4.1/#docs/forms/forms-checkboxes.html.
My desktop code is the following:
<%= check_box_tag
2005 Dec 21
3
Checkbox readonly
I declare some checkboxes :
<%= check_box_tag ''offers[]'', offer.id ,
@params[:offers].include?(offer.id.to_s) ,:readonly=>true %>
the result is :
<input checked="checked" id="offers[]" name="offers[]"
readonly="readonly" type="checkbox" value="1" />
But readonly doesn''t work ???
--
Posted
2006 Jul 04
1
Has_many :through with checkboxes?
Just when I started getting the hang of has_and_belongs_to_many
relationships, I realize that I should probably convert several of my
app''s joins to has_many :through type relationships.
One example, pairing users with categories via subscriptions, where
each user can be the "owner" of a category, has given me particular
trouble when I try to update a user''s
2006 Apr 04
6
check_box_tag is limited?
Hello all.
Am I going totally nuts here and just want to check (Natch!) something.
A normal check_box has two value posssibilities. One for checked and one
for unchecked, the value gets submitted with a form.
The check_box_tag on the other hand, has a checked_value (Called just
''value'') and for the unchecked value...nothing, zip, nada.
This means that if you submit a form with
2006 Feb 22
8
filtering "tags" via checkboxes - HABTM
First post/newbie post... bear with me.
What I''m trying to achive (music site):
A system containing tracks and moods with a HABTM relationship. I''ve
got all that set up and functioning in the admin environment - i.e.
admins can apply a variety of moods to a particular track via a
series of checkboxes. Join table works just fine.
I''m currently stuck on allowing
2008 Jan 31
3
Handling multiple Check boxes in a XHTML Strict way
Hi,
The default way we handle an array of checkboxes is like this:
<% items.each do |item| %>
<%= check_box_tag ''item[]'', "#{item.id}" %>
<% end -%>
this returns an array item[] that holds the ids of all the items.
Now the real issue:
1. The above loop will same ids to ''n'' items
2. All ids will be ''item[]''
2008 Dec 09
4
HABTM checkboxes insert but don't delete
I have a problem related with the HABTM relationships with checkboxes.
I''ve got a profile and a service model, both related with
has_and_belongs_to_many.
The problem is that i can insert new data in the profiles_services
table, however, i cant delete already existing data.
What could be the problem?
--~--~---------~--~----~------------~-------~--~----~
You received this message
2006 Jul 03
9
checkboxes
in the mean time i am using a checkbox like this :
<input type="checkbox" name="var[car]" <%= var.car ? ''checked'' : ''''
unless @var == nil %> />
but i am sure there is something better than this in rails like
<%= checkbox_tag ''var'', ''car'', :checked => true %>
but this is not
2008 Mar 02
2
check_box_tag remote_function
I have a collection of check_box_tags that look like the following:
<% for item in @items %>
<%= check_box_tag "item[item_ids][]", item.id, false, {:onchange =>
remote_function(:url => update_items_path, :with => "''items='' +
escape(value) "} %>
<%= item.name %>
<% end %>
My question is, how do I send all of the current
2006 Dec 27
0
HABTM Checkboxes - Adding/Updating Users to a Project
Hello all,
I''m trying to create a HABTM checkbox action that adds/updates ''users''
to a ''project''.
I have the following laid out.
---------------------
TABLES
---------------------
create_table "assignments", :id => false, :force => true do |t|
t.column "project_id", :integer, :default => 0, :null => false
2008 May 29
5
f.checkbox?
Okay so I have a typical search page where a keyword is entered and
results are retrieved that match the keyword. What I want to do now is
have checkboxes to search for results in specific areas (my site is a
big events calendar with "streams" and "audiences") I want to use the
checkboxes to look for results in ''streams'', ''audiences'', or
2006 Jul 14
2
multiple options & checkboxes
Hello,
I''m trying to implement a checkbox option function, but I''m having a
problem in visualizing how it needs to be implemented.
Let me explain. I have a model (User) and another model (Category). I
want the user to be able to select multiple categories in the form of
checkboxes and have this information stored in the db.
User habtm Category
and
Category habtm User
But
2003 Mar 12
1
patch: typo's and gcc warnings
Two patches:
one to correct the spelling of permissions (in comments, but such typos
disturb me as well), and
one to cast inode and dev to unsigned long before comparing, to prevent
gcc giving a warning "comparison between signed and unsigned".
Paul Slootman
-------------- next part --------------
diff -ru orig/rsync-2.5.6/generator.c rsync-2.5.6/generator.c
---
2006 May 11
3
multiple checkbox values, convert to string, 1 db field
Basically what I''m trying to do is create a way for users to enter
"keywords" that will then be searchable. I.e., when a user creates a
new Item, there is also a keywords field in the database that is a
string like "purple triangle free" -- but all the user sees when they
are creating the keywords is a series of checkboxes like:
__blue
__red
__purple
__circle
2011 Oct 21
20
How to transform my html form into a rails 3 form
Hi,
I have the following code working in a rails 3 view, but it is
unfortunately not pure rails code!
<% @filter1 = "tr.show1,tr.show2" %>
<% @filter2 = "tr.show1" %>
<% @filter3 = "tr.show2" %>
<form>
<p>
<input type="checkbox" value=<%=@filter1%> onclick="$
(this).is('':checked'')
2008 Jan 18
0
Update All using Checkboxes
So I have a list of jobs which I show like this. (cleaned up..)
_list.rhtml
<table>
<% for job in @jobs %>
<tr><td><%= job.name %></td></tr>
<% end %>
I want checkboxes next to each and every job name and a button or link
somewhere else on the page to "delete selected", "publish selected" ,
and "unpublish selected"
2007 May 25
3
check box value in array
Hi guys,
I have a group of check box in rails page.
check box Code as below:
<% for count in @total_cellno %>
<input name="checkbox" type="checkbox" value="<%= count %>" />
<% end %>
I want to receive the selected value in my controller model.
@selected_box << params["checkbox"]
I guess that it provides values
2006 Jul 19
3
How do I check the retuned value from check_box_tag?
Hi,
I have this in my form
<%= check_box_tag(@accept, value = "1", checked = false) %>
Which puts a nice checkbox on my form but when I try to retrieve the
value that is returned, which I expect to find in @accept, there is
nothing. How do I check the returned value?
Thanks,
Paul Thompson