Displaying 20 results from an estimated 60 matches for "tag_ids".
Did you mean:
tag_id
2006 May 07
6
Challenging SQL for you...
...s looks like:
[id][tag_id][taggable_id][taggable_type]
id and tag_id above serve to join the two tables...taggable_id is the id
of a tuple in another relation in the database, and type is the name of
said relation.
What I want to do is select * taggable_id''s from taggings that have
tag_ids matching a set of ids from the tags table.
So, my user might specify "hawaii, islands, girls, beach, beer" as a tag
query string, and I only want to pull taggable_id''s for those that are
tagged with *each* of these items...not, with either, as the current
plugin works.
Th...
2006 Aug 29
2
Excluding values from search term
I''m trying to do a search that would exclude a value from it and return
whatever results aren''t matched from the term, but it''s not working very
well.
None of these are working, they all return the results including the
ones with tag_id = 701
tag_id:(NOT 701)
tag_id:(! 701)
tag_id:(- 701)
But if I go the other way around it works (which I don''t want since
2006 Mar 31
7
problem with habtm conditions in pagination
Hello list,
I''ve had this problem for two days now. Perhaps someone here would
care to comment on it. I''d be REALLY appreciative if that''d be the case.
Basically, it''s outlined at this paste: http://rafb.net/paste/results/
kXQSHZ83.html
But I''ll paste it here, too.
The main problem is in the customers/list action. The problem is with
this line:
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
2010 Feb 14
2
has_many :through eager loading only loading one record
Hello,
I''ve been using Rails for years, including has_many :through and eager
loading, but this one has me stumped.
The problem is that Active Record is only eager-loading the first of
many records. Here are the models (note set_table_name for a legacy
schema):
class Tag < ActiveRecord::Base
set_table_name ''tag''
end
class DishTag < Tag
has_many
2006 Apr 15
6
Two forms for two models - one page
I''ve got two forms for two different models on the same page. What I
want is for one of the forms to return you to the same "new" page and
not clear the data in the other form. I was hoping it would be as
simple as render :action => ''new'' but no such luck.
Any thoughts?
Thanks,
Adam
--
Posted via http://www.ruby-forum.com/.
2013 Feb 28
1
Make `ActionView::Helpers::InstanceTag#tag_id`, `ActionView::Helpers::InstanceTag#tag_id_with_index(index)` public?
As I asked in StackOverflow<http://stackoverflow.com/questions/15127658/hoe-to-get-tag-id-from-a-record-in-form-for/15129741>
I think it would be helpful since we can dynamically create javascript code
to control each input tag in form helper, what do you think? Or there has
already been a solution?
--
You received this message because you are subscribed to the Google Groups "Ruby
2006 Jun 22
2
id column for join table... kosher?
I''ve got two tables, bookmarks & tags. Using a
has_and_belongs_to_many association, I can do lookups using a join
table called bookmarks_tags. Two questions:
1. Can I have a migration for my join tables? Rails seems to "know"
about join tables implicitly from the associations, but if I do a
rake migrate the join tables won''t be built. I''ve been
2010 Jan 15
1
Chaining queries in ActiveRecord
Hi all,
Stuck at this problem for several days. Tried to use named_scope,
scope_out, and plugin such as searchlogic, but no result.
The problem is as follows: I have a pic table and tag table, and a
join table called pic_tag (with only pic_id and tag_id) so that I can
associate N pics to M tags. This is the tutorial way to set up a many-
to-many association. I''m trying to implement a
2006 Aug 09
1
help:sql search for NULL
Hi,
I have two tables with identical fields(assignments, and matches).
However, only one of them accept NULL values for its fields. I want to
be able to find out all the matches for any assignment. The search
should retrun the match if the corresponding filed is NULL as well.
I wrote down the following code but it doesn''t return anything. I wonder
what I am doing wrong. Any help is
2006 Apr 26
3
acts_as_taggable gem: deleting tags
I have the following quick-and-dirty hack in my model:
def after_destroy
# search for orphaned tags and delete them
orphans = Resource.tags_count :count => ''= 0''
orphans.keys.each {|tag| Tags.find_by_name(''tag'').destroy}
end
It''s nice from a readable code perspective, but it seems inefficient -
is there some way to do this with only one
2006 Jun 30
0
find_by_sql not quoting properly (in acts_as_taggable plugin)
I have run into a very strange problem discovered through the use of
the acts_as_taggable plugin, but related to quoting/sanitizing the
interpolated list in a find_by_sql. Apologies for the length, but I
wanted to be complete. ;-)
The method from acts_as_taggable.rb is:
def find_tagged_with(list)
find_by_sql(["SELECT #{table_name}.* FROM #{table_name},
tags,
2006 Jan 23
2
del.icio.us-like output
I''m trying to build a page similar to a delicious page that is a listing of
your bookmarks in this format:
1. Querying serialized data in
ActiveRecord<http://www.karmiccoding.com/articles/2005/11/29/querying-serialized-data-in-activerecord>
Hack
to search serialized fields
to rails <http://del.icio.us/djsodom/rails> ... and 4 other
2005 Sep 06
6
strange behavior of acts_as_taggable
I was testing my models with this new library and I got:
>> s.tag "warp"
ActiveRecord::StatementInvalid: ERROR: inserción o actualización en la tabla
«tags_stories» viola la llave foránea «tags_stories_story_id_fkey»
DETAIL: La llave (story_id)=(8) no está presente en la tabla «stories».
: INSERT INTO tags_stories ("tag_id", "story_id") VALUES
2006 Dec 11
2
join and sort on 'best match'
Hi Everybody,
I have been breaking my head on the following problem: how to join 2
tables and sort the results on the best match.
explanation:
- there are 3 tables, items, tags and items_tags. The items_tags table
links items to tags.
- I have one item which has certain tags, and I want to look up all the
other items that have those tags as well
- results should be sorted and presented by
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
2005 May 23
1
has_and_belongs_to_many dual insert error ?
Hi !
(See references at the end)
I have a slight problem. Whenever I save one of my domain models, which
contains an has_and_belongs_to_many relationship with another one, the
relationships are doubled.
My domain is a series of pictures, where each picture can be tagged with
one or more words. So, a picture of my dog could be tagged "Jordy, Dog,
Dog 2005", for example.
In my
2006 Feb 09
3
acts_as_taggable Produces Bad SQL - Find Fails
I am using acts_as_taggable in my application and on the tagging side of
things, no problem at all. Running edge Rails and PostgreSQL 8.1.
I am then trying to find all my AR objects with a certain tag. The tag is:
lasvegas and I know that there are at least 3 records with that tag.
So, I''m doing this:
@lists = List.find_tagged_with :any => @search_string, :separator =>
2006 Jun 09
2
Creating An Extra Association Between Two Tables
Good Friday Everyone :-).
These are my models:
Problem -> has_and_belongs_to_many :tags
Tag -> has_and_belongs_to_many :problems
Now if a tag does not exist and I create it and associate it to the
problem it works
self.tags << Tag.create(:name => tag)
But if I have the tag already in the DB and just want to link it to
another problem it does not really like me. I do it
2006 Apr 04
5
How to implement tag clouds using plugin?
The code on
http://blog.craz8.com/articles/2005/10/28/acts_as_taggable-is-a-cool-piece-of-code
is based on the acts_as_taggable gem,anybody has done that using the
acts_as_taggable plugin?thanks!
btw:the code above uses the tag_count method,which is defined in the
gem:
def tags_count(options = {})
options = {:order => ''count DESC''}.merge(options)