similar to: limits of has_and_belongs_to_many

Displaying 20 results from an estimated 300 matches similar to: "limits of has_and_belongs_to_many"

2012 Apr 18
1
has_and_belongs_to_many: Item Already in Collection?
I''m putting together what should be a simple app using content and tags using has_and_belongs_to_many for each. create_table :contents_tags, :id => false do |t| t.references :content t.references :tag end When a user tries to add a new tag, I''m trying to detect if the content already has the tag. So ... I grab the tag like this: tag =
2006 Jan 04
5
check if a file exists?
Hello all! I have a list of people on a page, and some of this people have pictures of them stored on the web server. So I have an image tag like this on my page: <%= image_tag "/images/people/" + person.pers_id.to_s + ".jpg" %> But not all have a picture, so if the file for pers_id=1899 does not exist, i would like to display a custom image for that guy. How can I do
2006 Dec 06
2
validates_uniqueness_of where scope euqals created_by "magic" field
I have the following ActiveRecord objects: class Recipe < ActiveRecord::Base has_many :ratings, :dependent => true . . . end class Rating < ActiveRecord::Base validates_uniqueness_of :created_by, :scope => :recipe_id belongs_to :recipe, :counter_cache => true . . . end The created_by field on Rating is implemented as a "magic" field similar to this:
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
2011 Feb 19
2
Active Record Query
A course has many lessons and a lesson has many topics. A topic can have a recipe or vice versa, a recipe has many topics (optional). I need to come up with the most efficient way of querying the database to find those topics belonging to a course (via lessons of course) which have a recipe (in other words recipe_id is not null for this topic record). Simple but challenging :) Thanks for your
2006 May 07
6
RuntimeError in Recipe#edit
I have tried to learn ruby on rails from scratch by going into a tutorial at the following website. http://instantrails.rubyforge.org/tutorial/index.html I followed the suggestions and encountered 3 problems so far. 1. Couldn''t start the Apache server. Error message "Port 80 was used by some other process." I over-came the problem by going into configuration and change the
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 May 20
3
In a find, can''t you use both :include and :limit ?
I''m trying to do a find that includes a join. It has to be a find because I''m using the results for a Pagination, so I need to limit my query to the number of results I want to display per page. Here''s the type of thing I want to do: Employee table <-> Skills_Employees table <-> Skills table Let''s say I want to find all the employees who have
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
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
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"
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.
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
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
2006 May 09
6
Still Stumbled on First things in trying RubyOnRails
Still Stumbled on First things in trying RubyOnRails http://www.digitalmediaminute.com/article/1816/top-ruby-on-rails-tutorials http://www.onlamp.com/pub/a/onlamp/2005/01/20/rails.html http://instantrails.rubyforge.org/tutorial/index.html http://rails.homelinux.org/ I had tried the first of the top 12 tutorials and got stuck after adding a new field ?category_id?in the table recipes,
2009 Sep 22
1
new git hook to be installed
We've all wanted to be able to tweak a few server-side settings, without having to find/ask/wait for someone do something manually on the server. With this change to ovirt's "update" hook, you can now do just that by pushing a specially formed tag to the remote repository. (once this hook is installed) If that tag meets several criteria, the "update" hook will run the