search for: tag_names

Displaying 20 results from an estimated 54 matches for "tag_names".

Did you mean: tag_name
2006 Feb 26
5
Help On Associations Extension.
...ongs_to_many association so that i can do something like this on the location model: myLocation.tags.add_by_names ''tag1 tag2 tag3'' On the extension i want to do something like this: class Location < ActiveRecord::Base has_and_belongs_to_many :tags do def add_by_names tag_names tag_names.split(" ").each do |tag_name| tag = Tag.find_by_name(tag_name) || Tag.create(:name => tag_name) tags << tag unless tags.find(tag.id) end end end The problem is, that i cant feager out how to have access to location tags collection inside...
2006 Apr 28
1
acts_as_taggable help
...s = Item.tags_count(:limit => 100) end IN the VIEW <% @items.each do |item| %> <%= render :partial => ''list_stripes'', :locals => { :item => item } %> <% end %> Where the partial _list_stripes.rthml is a list of items <td><%=h item.tag_names.join(" ") %></td> <td><%=h item.created_on %></td> <td><%=h item.category.name %></td> But i get an error "undefined method `tag_names'' for #<Array:0x3673b08>" any ideas? -- Posted via http://www.ruby-forum...
2006 Apr 17
6
acts_as_taggable confused
...ollection photo.tag "wine beer alcohol" # don''t need to split since it''s an array, but replaces the tags collection # trailing and leading spaces are properly removed photo.tag [ ''wine '', '' vodka''], :clear => true photo.tag_names # => [ ''wine'', ''vodka'' ] # appends new tags with a different separator # the ''wine'' tag won?t be duplicated photo.tag_names << ''wine, beer, alcohol'', :separator => '','' # The difference be...
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
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 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 28
0
acts_as_taggable vulnerable to attacks ?
Hi all ! I''d like to confirm if I''m reading correctly. It seems ActiveRecord::Acts::Taggable::SingletonMethods#find_tagged_with is vulnerable to SQL injection attacks: def find_tagged_with(options = {}) options = { :separator => '' '' }.merge(options) tag_names = ActiveRecord::Acts::Taggable.split_tag_names(options[:any] || options[:all], options[:separator]) raise "No tags were passed to :any or :all options" if tag_names.empty? o, o_pk, o_fk, t, t_pk, t_fk, jt = set_locals_for_sql sql = "SELECT #{o}.* FROM #{jt}, #{o}, #{t} WHERE #...
2006 Feb 28
2
acts_as_taggable and auto_complete
I''m using the acts_as_taggable gem (who''s site has gone AWOL apparently) and I''m wanting to make it autocomplete. I, however, am the absolute worst JavaScript person ever, so is there anyone out there that can point me to a tutorial or give some good starting points? Thanks! Kenneth -- => the blog from beyond <= => www.eyeheartzombies.com <=
2005 Dec 16
1
acts_as_taggable sql injection vulnerability
...notified Obie of this over a month ago, so hopefully he''s fixed it. How to tell lif you''re vulnerable ====================== Make a tag with a single quote in it. See if raises an error. Now, go delete your entire database. How to fix ======== add/change the last line of split_tag_names tag_names = tag_names.flatten.map { |name| ActiveRecord::Base.connection.quote_string(tag.name.strip) } }.uniq.compact -- Remember to restart your app. court3nay http://caboo.se :: we like big fonts and yellow highlighting http://habtm.com :: personal codelog http://placelist.com :: just like...
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 Feb 13
0
count_as_taggable distinctly
I needed to count tagged records, I came up with this: <pre>def count_tagged_with(options = {}) options = { :separator => '' '' }.merge(options) tag_names = ActiveRecord::Acts::Taggable.split_tag_names(options[:any] || options[:all], options[:separator]) raise "No tags were passed to :any or :all options" if tag_names.empty? o, o_pk, o_fk, t, t_pk, t_fk, jt = set_locals_for_sql sql = "SELECT COUNT(DIST...
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
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
2015 Jun 15
2
git daemon on zytor is back in action
On 06/15/2015 12:50 PM, Ady wrote: > > Oops. Sorry, the other way around. > > If I understand correctly > > /tag/?id=/refs/tags/syslinux-4.07 > > refers to the name of the tag, "syslinux-4.07" > > whereas: > > /tag/?id=a4fcb6d867aadcaf5af8f87eb1ba96abe2748159 > > would be the corresponding reference to the hash. The
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"