On Aug 6, 3:30 pm, bingo bob <rails-mailing-l...@andreas-s.net> wrote:
> Ok, I'm sold - I'll put it in the model - user model I take it?
>
> What's the maxed_adverts? method look like then ? and how do i call it
> from the create action in the adverts_controller ?
> --
> Posted viahttp://www.ruby-forum.com/.

The User model does sound reasonable.

maxed_adverts? looks like something that checks if the user has maxed
their advert limit. Maybe it looks like "def maxed_averts?;
averts.count >= 3; end"? Maybe it looks different.

Call it like you would any other method on your models... I guess it
helps when your starting out to always remember that Rails "models"
are nothing more than instances of Ruby classes which *usually*
descend from ActiveRecord::Base. Nothing magical about them but the
magic you give them.
--~--~---------~--~----~------------~-------~--~----~
You received this message because you are subscribed to the Google Groups "Ruby 
on Rails: Talk" group.
To post to this group, send email to rubyonrails-talk@googlegroups.com
To unsubscribe from this group, send email to 
rubyonrails-talk+unsubscr...@googlegroups.com
For more options, visit this group at 
http://groups.google.com/group/rubyonrails-talk?hl=en
-~----------~----~----~----~------~----~------~--~---

Reply via email to