Displaying 2 results from an estimated 2 matches for "keywordlink".
Did you mean:
keyword_link
2006 Jul 11
0
Inplace editor oddity
...#in keyword_controller.rb
def set_bid
params[:value].gsub!(/[^\d\.]/, '''')
if params[:value].to_f == 0.0
render :update do |page|
page.alert(''You must enter a dollar amount, e.g. 23.22, 0.23'')
end
return false
end
@link = KeywordLink.find(params[:id])
previous = @link.max_bid
@link.max_bid = params[:value]
@link.max_bid = previous unless @link.save
render :text => help.number_to_currency(@link.max_bid)
end
#in view
<%= in_place_editor ''bid_'' + keyword.id.to_s,
:ur...
2006 Jun 26
4
has_many :through
...:Base
has_many :keyword_links
has_many :keywords, :through => :keyword_links, :conditions => "active =
1"
end
class Keyword < ActiveRecord::Base
has_many :keyword_links
has_many :listings, :through => :keyword_links, :conditions => "active =
1"
end
class KeywordLink < ActiveRecord::Base
belongs_to :keyword
belongs_to :listing
end
the problem is, when i loop through all the @listing.keywords, I get ALL the
keyword_links instead of just the keyword_links for that listing. For
instance, if my @listing has an ID of 7, I''ll still have keyword_list...