Aston J. wrote in post #968740:
I have a form for @topic that contains two fields, name(string)
visible(boolean)
When the user submits the form, I want to manipulate the contents of the
attribute :name (which I am able to do - but it's the next part I'm
stuck on)
-and then-
see if a
Thanks for the reply both. Does this make it any clearer? It is my
create action based on what Philip said - but it does not work:
Topic(#2171041280) expected, got Hash(#2151972860)
def hashtag(name)
string = name
return name = string if string.split.count = 1
name =
Thanks for the reply both. Does this make it any clearer? It is my
create action based on what Philip said - but it does not work:
Topic(#2171041280) expected, got Hash(#2151972860)
You're trying to add a hash to an AR association... Rails doesn't like that :)
def hashtag(name)
Hey thanks! Just like to say that factory_girl_rails (factory_girl
for Rails 3) works excellently.
On Dec 6, 5:24 pm, Marnen Laibow-Koser li...@ruby-forum.com wrote:
daze wrote in post #966672:
What is the preferred way to have testing data - fixtures, or
something like factory_girl
daze wrote in post #966672:
What is the preferred way to have testing data - fixtures, or
something like factory_girl (https://github.com/thoughtbot/
factory_girl)?
Factories. Never use fixtures, ever, for anything.
I definitely need something that can handle relationships between
things
On Fri, Jan 29, 2010 at 10:52 PM, Steve Castaneda li...@ruby-forum.com wrote:
Jamey Cribbs wrote:
Sounds like you do not have your associations defined correctly in your
model.
In your Buyer model you should have this line:
belongs_to :status
In your Status model you should have this
Steve Castaneda wrote:
Jamey Cribbs wrote:
Sounds like you do not have your associations defined correctly in your
model.
In your Buyer model you should have this line:
belongs_to :status
In your Status model you should have this line:
has_many :buyers
HTH,
Jamey
I'm beginning to think there needs to be a third table; one whose
columns are:
id, buyer_id, status_id
This would be my first time doing it like this though, so I sort of get
stuck understanding how the route is supposed to work.
--
Posted via http://www.ruby-forum.com/.
--
You received
Jamey Cribbs wrote:
Sounds like you do not have your associations defined correctly in your
model.
In your Buyer model you should have this line:
belongs_to :status
In your Status model you should have this line:
has_many :buyers
HTH,
Jamey
That was it! Thank you
Do you mean there are products of different types ( models )
quite confused ??
On Fri, Jun 5, 2009 at 9:33 PM, Yanni Mac
rails-mailing-l...@andreas-s.netwrote:
I have a Store model that has_many Products. I need to allow the users
to filter on certain conditions in the products. For
There are not different models for products. Product is one model and
it has fields for price, etc.. I want to filter out products based on
price:
:conditions=price50
Sandip Ransing wrote:
Do you mean there are products of different types ( models )
quite confused ??
On Fri, Jun 5,
You're probably looking for named scopes. They can be used to add
conditions to an association, like store.products, on the fly.
For instance, if you have these named scopes on your Product model:
named_scope :price_less_than, lambda { |p| { :conditions = ['price
= ?', p] } }
named_scope
12 matches
Mail list logo