similar to: has_and_belongs_to_many: Item Already in Collection?

Displaying 20 results from an estimated 2000 matches similar to: "has_and_belongs_to_many: Item Already in Collection?"

2006 Jan 19
5
limits of has_and_belongs_to_many
I''m experimenting with Rails on the Recipes example first before I dive into applying it to my intended application. I''m exploring which will be more work: to rename all the primary id''s in the legacy database, or to work around the fact that the primary id''s are not called ''id'' within RoR instead. I''ve been successful in using a
2006 Feb 26
5
Help On Associations Extension.
Hi to all, I''m needing some help here ... I want to do an extension on a has_and_belongs_to_many to build a custom add method to the association. i have a table locations that has a many-to-many association with a tags tabel using a locations_tags table. i want to add a method to the Location has_and_belongs_to_many association so that i can do something like this on the location
2006 Apr 28
1
acts_as_taggable help
Ahoy, having a bit of difficulty w/ the acts as taggable GEM. I was able to create a tagcloud, but now i want to filter items by tags. in my controller i have def show_tagged_with <-- snip snip --> @items = Item.find_tagged_with( :any => params[:tag_name]) @categories = Category.find_all @tag_name = params[:tag_name] @tagged_items = Item.tags_count(:limit
2006 Jun 21
7
acts_as_taggable and paginate?
Hi there, I''ve been trying to paginate over a list of members that all share a tag in common using the acts_as_taggable plugin. The regular way of paginating over a collection doesn''t seem to work with acts_as_taggable. Here''s what my method looks like that takes in a tag name, finds all the members that share the tag and then displays all the members. Nothing too fancy
2006 Jul 31
1
How to get result of following SQL Query in Ruby?
Hi, I have 2 tables as follows:- _________________ ________________ ____________ taggings | |stores | | tags | -----------------| |---------------| |------------| --tag_id | |--store_id | |tag_id | --store_id | |--store_name | |tag_name | --user_id | |---------------| |------------| -----------------| Now I want to execute
2006 May 12
2
Problem regarding accessing attributes from object...
Hi, I have an object (@cnt). Now when I am calling "@cnt.inspect" on object it gives me output as follows:- ----output---- [#"3"}>] ----------- Now in aboove output the number between double quotes (3) which is of my interest & I want to display it. How to do that? Actually this is my method:- ==================================== class Tagging < ActiveRecord::Base
2006 Mar 13
5
Displaying related entries by tags - HELP!
Ok, my site is setup like pretty much every other blog out there. A list of the most recent 5 posts, then by clicking one, you go to an individual post page, displaying the full context of that post. Now, what I would like to do is to display the related entries in the side column, which is part of the layout, based on the tags belonging to that specific entry. Here''s my coding so
2010 Oct 14
1
Cucumber Selenium web step to verify value of input field
I have an input field with an id which has a value. The web_steps.rb method does not find the value. Is this the right step to use to check an input field? It works fine for a text_area but not an input. Scenario steps (tried both ways): Then the "travel_card_number_gate" field should contain "5" Then the "#travel_card_number_gate" field should contain "5"
2006 Dec 26
0
acts_as_taggable Plugin issue (not gem)
I tried to post this earlier, but it never came through. I''ve got something working in console, but not in controller. Any idea why? This is the plugin not the gem of acts_as_taggable *View* <code> <h1>Listing elements</h1> <% if @elements.blank? %> <p>There are currently no elements in the system tagged <%=
2006 Dec 27
4
acts_as_taggable issue
This won''t post with a full code paste, so I''ve got to link it to another forum where I''ve posted it. http://www.railsweenie.com/forums/1/topics/1053 Can''t get the acts_as_taggable plugin to play nice. Works in console, not in teh view. --~--~---------~--~----~------------~-------~--~----~ You received this message because you are subscribed to the Google
2015 Jun 15
3
git daemon on zytor is back in action
On 06/15/2015 01:08 PM, Ady via Syslinux wrote: > > Example in repo.or.cz: > > tag name: > http://repo.or.cz/syslinux.git > /tag/refs/tags/syslinux-4.07 > > tag hash: > http://repo.or.cz/syslinux.git > /tag/a4fcb6d867aadcaf5af8f87eb1ba96abe2748159 > > If I understand correctly, the corresponding syntax for git.zytor.com > and kernel.org would
2007 Nov 29
0
has_many_polymorphs for user owned tags
Hi all, I''m trying to extend the tagging functionality of has_many_polymorphs to work with user owned tags - ie, putting belongs_to :user in the Tagging model. So I changed the index in the generated migration, and added user_id to the taggings table. Then I added belongs_to :user in the Tagging model. In the lib/tagging_extensions.rb file I added a new function: def
2006 Jul 24
2
InPlaceSelectEditor question
I''m attempting to use the example given in the Rails Recipes book chapter 2, to create a select drop-down using the InPlaceEditor function (modified to be InPlaceSelectEditor. The example given works (a country list drop-down), but I''m attempting to use it to display a list of items generated from an object in another table that is linked to the table that I''m editing.
2005 Mar 01
0
has_and_belongs_to_many problem
I''m having a problem with a has_and_belongs_to_many (habtm) association between two models with extra attributes. I''m writing a comic book database, and each issue has many creators on it. Thing is, some creators perform multiple duties. They may write one issue, draw another, etc. However, if I add a creator twice to an issue and try to delete it, it removes both creators:
2006 May 08
2
Queries with has_and_belongs_to_many relationship
I was able to create a has_and_belongs_to_many relationship for my app, but now I''m not too sure how to write queries for it. Basically, I have a table ''courses'' that has_and_belongs_to_many ''categories'' and vice versa So I''m trying to figure out how I would find only the courses that belong to a category that I specify. Let''s
2006 Apr 06
3
has_and_belongs_to_many find
Say I have a post model that has_and_belongs_to_many :categories, and a category model that has_and_belongs_to_many :posts. So I have a categories_posts table to do the join. That''s all find and dandy. However I want to be able to find all the posts that belong to a specific category. I tried Post.find_by_category(:id) but that doesn''t work. Does anyone have any insight?
2006 May 26
0
has_and_belongs_to_many with fk constraints?
Hi folks, I''m wondering if it''s possible to use foreign key constraints on the join tables of a has_and_belongs_to_many relation. Specifically, I get this error when I try and delete a model I''m using, named saved_search, which is many-to-many with neighborhoods. Any ideas? Thanks for any help. :-) -Eric Code: @saved_search.destroy Error: Mupdate or delete on
2006 Jan 16
0
belongs_to with has_and_belongs_to_many
I''m having a problem with belongs_to and has_and_belongs_to_many. Here''s a brief summary of the models involved: class Member < ActiveRecord::Base set_primary_key ''member_id'' has_and_belongs_to_many :projects, :join_table => ''projects__members'' has_many :projects, :foreign_key => ''created_by'' end class
2005 Oct 05
0
has_and_belongs_to_many on legacy DB
I am working with mapping ActiveRecord onto a legacy database. All is going well (using set_table_name, set_primary_key, etc), but I can''t get my many<=>many relationships to work. My contrived example of the situation: Student has_and_belongs_to_many Teachers. This is mapped via table student2teacher where the foreign keys are studentId and teacherId. The primary key in Student
2006 Jul 14
5
Acts_As_Taggable Plugin multiple controllers.
I have Acts_As_Taggable Plugin working. I have a HR controller and a sales controller. I have a document in hr tagged whitepaper and a differnent document in sales tagged whitepaper when I am in hr I see the hr document tagged with whitepaper and not the sale document (what I want). but if I click on the tag whitepaper I return two documents, hr and sales. I just want to return the hr document