similar to: Saving a collection field with <<

Displaying 20 results from an estimated 6000 matches similar to: "Saving a collection field with <<"

2001 Apr 06
3
$MAIL surprise
I got email yesterday from a user who had run 'from' and got the message "No mail in /home/stevev/$USER" (where $USER was that person's username). At first I thought he had pilfered my .bashrc, but on further investigation I discovered that my home directory path had been compiled in to sshd, because the configuration tests assume that the directory part of $MAIL is the
2006 Feb 27
12
RedCloth
Is this the prefered method to implement RedCloth in your views. I''m trying to display user input that will sometimes have code references in it. This strips out all tags. I would like for the tags to be displayed but not read as html. Thanks in advance! <%= RedCloth.new(strip_tags(comment.comment),[:filter_html]).to_html %> charlie bowman recentrambles.com -- Posted via
2006 Feb 25
7
generating HTML instead of XHTML
After reading http://www.hixie.ch/advocacy/xhtml and having some headaches with IE, I wonder whether helpers can be configured to generate HTML instead of XHTML. -- fxn
2008 Mar 25
0
filter collection based on field value in the index.rhtml
Hi, I am using Rails 1.2.6 i have an items controller. i am using the templated index.rhtml so it displays everything in my items table each item has the following fields in database. id name category which is non unique price what i need is let say there is a drop down list in the index.rhtml which contains all the possible values of category in the items table. (I have managed this.)
2010 Feb 03
1
Additional field data collection
This is a subset of a much larger dataframe. I would like to be able to automate finding the pair of x, y coordinates where the line crosses zero agian x <- (structure(list(bankfull_depths_m = c(0, 0.17, 0.38, 0.37, 0.36, 0.39, 0.47, 0.48, 0.19, 0.05, -0.05, -0.09), measurment_num_m = c(0.2, 0.4, 0.6, 0.8, 1, 1.2, 1.4, 1.6, 1.8, 2, 2.2, 2.4)), .Names = c("bankfull_depths_m",
2006 Jan 12
0
HABTM with conditional field in relation table
Hi all I have members in my application, and every member can assign other members as buddies. class Member < ActiveRecord::Base # Hat folgende Buddies has_and_belongs_to_many :buddies, :class_name => ''Member'', :join_table => ''members_have_buddies'',
2005 Dec 24
3
Avoiding HABTM field clobbering?
>From the docs: "Note that any fields in the join table will override matching field names in the two joined tables. As a consequence, having an "id" field in the join table usually has the undesirable result of clobbering the "id" fields in either of the other two tables." I do have an ID field in the join table, and as a result it''s clobbering the ID
2006 Feb 01
0
habtm and counter (xxx_count field in DB)
Hi all I have the following models: class Member < ActiveRecord::Base # DJ Profiles the member is part of has_and_belongs_to_many :disc_jockeys, :join_table => ''members_are_disc_jockeys'', :uniq => true end class DiscJockey < ActiveRecord::Base # Members that are part of this DJ profile
2006 Aug 12
7
Collection assignment to a has_many :through
I''m working on a simple photo gallery in rails, it seems to be a good project for a newbie. I have photos and categories, many-to-many association. It worked well with HABTM. Then I decided that it would be good to be able to change order of the photos so that thumbnail pages would look less chaotic. So I created a Layout model which is a join model (or whatever it is called) that
2006 May 10
1
Validates_uniqueness_of multiple field combo?
Hello, I am new to Ruby on rails and this is therefore probably trivial. Lets say I have 3 tables - users[id,name, age, ...], interests[id,name,description, ...], and finally a table user_interests[id,user_id,interest_id] to link a user to a set of interests. Now there is no problem to put validates_uniqueness_of :name in the user-model to ensure that I only have one Lenny, but how do I
2005 Dec 31
4
saving a collection
Reading the Agile book, I can''t find a single command to save a collection. The save command seems to operate on only individual objects. Lets say I have a collection that I have received from a find_all command. I want to go through and change some attributes in various objects in the collection. Then I want to resave the whole collection back to the database. I don''t think
2006 Jan 12
1
Saving habtm relationships and Rails 1.0
I know there''s a problem saving has_and_belongs_to_many relationships w/ Rails 1.0 in that only the first association is saved (http://dev.rubyonrails.org/ticket/3213). What are people doing about this? I guess I could move to using the trunk release, but I''m hesitant because that might introduce a bunch of unknowns. Is there a workaround? For example, a way to explicitly
2006 Jun 09
1
Updating Fields In Migration for HABTM Relationship
Earlier I forgot to add updated_at and created_at columns for my HABTM relationship so I created a migration to add them. In the migration I also want to go back and set the value of the created_at and updated_at columns for the previous rows. What is the best way to do that? Initially I thought I was being smart and decided to put an UPDATE SQL query in a find_by_sql statement and
2006 Jan 06
6
HABTM problem not saving all associations
Hello all, I have an Order object that has and belongs to many Products and has and belongs to many Loan Types. This is so I can select multiples of each in my order entry screen via checkbox groups. I''m having some trouble with saving multiple HABTM associations for a single model object; only the first HABTM association declared in the model will save during the initial @order.save
2012 Nov 03
0
ids writer fields for HABTM relationship.
Hello forum readers, Let''s say i have two models: Person and Role (i replicated the problem with Post & Tag as well, as i thought the problem was linked to some application-specific rights problem, but it wasn''t). In Person, attr_accessible role_ids is declared, so it accepts an array of Role ids as an argument when creating / updating. If i fire up the rails console and
2006 Apr 20
2
Additional Fields in a Join Table
Hi, I am creating an order management web application, and have run into an issue over join tables. I am reading Agile Web Development and it says that I can put additional fields within my join tables, and they give the example of a date field. I want to know if it is possible to do the following: I have an orders table with the order information as well as an orders_items table and an
2006 May 27
3
Saving an Array to MySQL... data changes...
I have a multiple select menu: <%= select_tag ''resume[employer_1_industry][]'', options_for_select(industries_helper, @resume.employer_1_industry), :multiple=> true %> It produces this HTML: <select id="resume[employer_1_industry][]" multiple="multiple" name="resume[employer_1_industry][]"> <option value="">-
2006 Apr 05
3
CRUD pattern for has_many relationships (forms containing collections)?
Hello folks! Beare with me for a second, while I explain my problem. Assuming we have the trivial model of class Author has_many :books end class Book end How do people go about creating the authors/edit and authors/new views if you want to be able to add and remove arbitrary amount of Books at Author creation and edit time? What I mean by this is that I go to
2006 Jul 08
2
Creating/Saving dependent objects
Folks, Am new to RoR and am building an example to get myself familiar. I am running into a simple issue while creating a user registration page. I have a User and Address models defined as below (partial/relevant code included below). User has_one address and Address belongs_to user. I have a foreign key defined in address table that refers to user(id) In a form I take in username, password,
2006 Jan 09
1
Saving an upload
I am creating a database for movies (films) and television shows (shows) that will have has_and_belongs_to_many relationships with the pictures table. CREATE TABLE screenshots ( id serial NOT NULL, filename character varying NOT NULL, content_type character varying NOT NULL, primary key (id) ); CREATE TABLE films ( id serial NOT NULL, name character varying NOT NULL,