similar to: has_many / : through / check_box - update problems

Displaying 20 results from an estimated 1100 matches similar to: "has_many / : through / check_box - update problems"

2006 Apr 18
2
check_box
I''ve got a question on the use of check_box. *** This is working but there just has to be a better way: RHTML: <% for book in @books do %> <tr> <td><%=book.label%></td> <td> <%checked = book.subscribed ? ''checked'': ''nope''%> <%=check_box("book" + book.id.to_s,
2006 Oct 15
2
Getting check_box to default to checked?
I''ve tried this (in a new method/template -- so @type doesn''t actually exist yet): check_box ''type'', ''notify_on_create'', {:checked=>''true''} But :checked seems to get swallowed. I''ve also tried setting notify_on_create to true in the Type model, but that doesn''t work either. Any way to get the
2006 Jul 19
6
Howto: Check_box with a variable (no model)
Hi, I would like to put a checkbox on a form where the input field is a variable rather than a field in a model. The normal way (with a model) would be: <%= check_box(''client'', ''accept'', {}, "1", "0") %> But since accept is a variable @accept and model client will not be there, how do I make a check box work? Regards, Paul
2006 May 03
2
disabled check_box does not work as expected?
I have a checkbox: <%= check_box(:day, :monday, {:disabled => ''''} , (day.monday == true ? {:checked => ''checked''} : {:checked => false} )) %> It is disabled allright, but it is always uncecked. Is this supposed to happen. It looks like (day.monday == true ? {:checked => ''checked''} : {:checked => false} ) is not
2006 Nov 04
0
Check_box woes
I have a User model and an Address model. A user has_many addresses, and an address belongs_to a user. An address object for a user could be a billing, shipping or marketing address. The way I''m tracking this is via the user attributes: billing_adress_id, marketing_address_id and shipping_address_id in the user table, which holds the relevant address id. But in my form that allows a
2006 Aug 10
2
check_box form helper questions/issues
I''m using Rails 1.1.x and it looks like the check_box form helper expects me to provide and object and method so it can determine if the checkbox should be checked or not. I''m having a couple of issues with this. note: I''m using UserEngine and adding a HABTM so that: class User < ActiveRecord::Base has_and_belongs_to_many :foos end class foo <
2006 May 03
1
Differences betwen check_box_tag and check_box form helper.
What is the difference between the check_box_tag and the check_box form helper? I can''t understand why both must exist. :( Thanks. Fernando Lujan
2006 Jun 07
5
check_box:how to update 2 checkboxes dependent on each other
I''ve got the following problem, I''ve created two check_boxes in my view. The user has to select one check_box, but isn''t allowed to seth both of them together on true. Now i am looking for functionality that can help me doing the folling: Scenario 1 CheckBox1 = True, The user sets CheckBox2 from False to True, now CheckBox1 should automatically become False.
2007 Apr 30
0
check_box
I am sure this is a trivial problem for a rails guru! all I want to do is display an appropriately cheched check_box in a table, so: instead of <% for t in @patient.histories%> <tr> <td><%= t.ihd %></td> </tr> <%end%> I want something like: <% for t in @patient.histories%> <tr>
2010 Nov 11
2
Rails 3 - Nested Forms, using Builder -- Check_box issue
Hello, I have the following: My Controller: def new . . @teammembers.each do |teammember| request = @request_thread.requests.build(:recipient_id => teammember.user_id, :full_name => ''Billy Bob T'') end My View: . . <%= f.fields_for :requests do |builder| %> <div class="field"> <%= builder.label
2007 Dec 15
3
check_box not being checked
I''m new to RoR and I''m having a little problem that I can''t solve. My model is simple. I have Lists and ListItems. I have a view that loops through all the list items, and I put the HTML for the each list item row in a partial called _list_item.rhtml. This is the view, called show.rhtml <ul> <%= render(:partial => "list_item", :collection =>
2006 Nov 27
0
Problems using check_box
Hello! Since this is my first post here and I''m fairly new with the whole RoR concept, please bare with me (just wanted that to be out in the open)! ;D I''m trying to make a checkbox for each input in another model/database-table. I have a database table called Roster which includes the colums "id" and "name". And then I have a table called matches that
2008 Aug 20
0
Re: problem in check_box
Shandy, Fred; Thanks! I never knew we could use remote_function this way. Learning something new every day! Best regards, Bill --~--~---------~--~----~------------~-------~--~----~ You received this message because you are subscribed to the Google Groups "Ruby on Rails: Talk" group. To post to this group, send email to rubyonrails-talk-/JYPxA39Uh5TLH3MbocFFw@public.gmane.org To
2008 Jan 23
2
CSRF / cached authenticity tokens / ajax requests
I''m going to go out on a limb here and say the new CSRF protection in Rails is flawed. Why? Forget about caching if you care to use it. Consider the following: <% cache do %> <%= link_to_remote "Add To Favorites", :url => {:controller => "favorites", :action => "create", "movie_id" => 2} %> <% end %> # Output <a
2006 May 09
1
Beginner questions on attributes and arrays
Hello, I am trying to do something and I''ve been reading my Agile Web Development with Rails book and doing internet searches for several hours now and I have made no progress. Here''s the issue: I have a table of sales reps that is linked to a table of territories. There are around a thousand territories that are numbered and each sales reps has many territories. I will
2006 Aug 16
3
Question RE Rails associations
Hi, I am new to Ruby and Rails programming and am having difficulty with the following scenario... Consider the following model: class Studio < ActiveRecord::Base has_many :movies has_and_belongs_to_many :actors end class Movie < ActiveRecord::Base belongs_to :studio has_and_belongs_to_many :actors end class Actor < ActiveRecord::Base has_and_belongs_to_many :studios
2007 Apr 16
6
How to use a form.check_box ?
Hey guys, I''m trying to have a simple webform in my administration section to add a user. I have the text_fields for adding the user''s name, password, and password confirmation, but cannot seem to figure out the checkbox. I want it to be a single checkbox, that if clicked, will set the database column "access" to be "admin" and if its unchecked, set it to be
2006 Aug 17
1
More on n-way.
Hey, i found some n-way threads on the list, but I think they don`t solve my case, or I didn`t understand how all of it works. I''m new to Rails, so be pacient. :) I''ll use an example of movie catalog, I''m realing doing a kind of movie catalog, for laerning rails, and I did this: Models: Movie, Actor, Director, Writer, Country, Language The Movie model HABTM Actor,
2006 Jul 06
0
Paging with multiple tables/models
I''m looking for a smooth way to implement paging over a combination of two tables. My application tracks which books and movies you have borrowed from me. For reasons that make sense elsewhere in the application, these are seperated out into two tables: book_borrowers and movie_borrowers and therefore 2 different activerec objects: BookBorrower and MovieBorrower This particular screen
2012 Dec 03
1
Resampling Help Needed
I am using package ks() to build 3D representations of bird territories and calculate territory volume from spatial data (simply x, y, and z coordinates). What I want to do is determine at what sample size (# locations collected) does the territory volume stop increasing. This should give me an idea of the number of points needed for future seasons. So I have a couple of birds each with 200