Thanks for info, appreciated!

I suspect it is weird to do a PeriodController just to keep the 
Period-code somewhere. So, where would you put create-code for the 
models that does not have own controllers?


class CalendarController

  # TODO: where does this belong? If there are
  # more than CalendarView that needs to createPeriod.
  def createPeriod
    @p = Period.new
    @p.startDay = param1
    @p.startDay = param2
    @p.save!
...

Robert Walker wrote:
>> Q: Where do I put the code for creating the Period? Should I setup a
>> PeriodController and redirect from CalendarController to
>> PeriodController.create somehow? Or maybe I should just do Period.save
>> from CalendarController?
> This seems to be a point of confusion. A "resource" in the Rails 
> interpretation of the REST convention is not a one-to-one correspondence 
> to "model" objects in an MVC design pattern. It just happens that models 
> tend to be represented by, and as, a resource.
> 
-- 
Posted via http://www.ruby-forum.com/.

--~--~---------~--~----~------------~-------~--~----~
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 [email protected]
To unsubscribe from this group, send email to [EMAIL PROTECTED]
For more options, visit this group at 
http://groups.google.com/group/rubyonrails-talk?hl=en
-~----------~----~----~----~------~----~------~--~---

Reply via email to