Hi, Newbie here...Is it possible to create a controller without a model? Example: a CRM app has a "calendar" type of page. I''m thinking the URL would be /calendar/action. There is no dedicated "calendar" table in the d/b but rather a collection of calls, tasks, meetings, etc. Is it as simple as creating a calendar controller? I''ve tried but keep getting "recognition failed...". I''m guessing a SQL view can be created and the model gen''d off of that but am curious about other possibilities. Thanks! Shawn --~--~---------~--~----~------------~-------~--~----~ 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-/JYPxA39Uh5TLH3MbocFFw@public.gmane.org To unsubscribe from this group, send email to rubyonrails-talk-unsubscribe-/JYPxA39Uh5TLH3MbocFFw@public.gmane.org For more options, visit this group at http://groups.google.com/group/rubyonrails-talk?hl=en -~----------~----~----~----~------~----~------~--~---
Of course, controllers are not "hard linked" with models, 1 controller can have 0-N models and 1 model can have 0-N controllers, they are completely independant. shware1 wrote:> Hi, > > Newbie here...Is it possible to create a controller without a model? > > Example: a CRM app has a "calendar" type of page. I''m thinking the URL > would be /calendar/action. There is no dedicated "calendar" table in > the d/b but rather a collection of calls, tasks, meetings, etc. Is it > as simple as creating a calendar controller? I''ve tried but keep > getting "recognition failed...". > > I''m guessing a SQL view can be created and the model gen''d off of that > but am curious about other possibilities. > > Thanks! > > > Shawn-- 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 rubyonrails-talk-/JYPxA39Uh5TLH3MbocFFw@public.gmane.org To unsubscribe from this group, send email to rubyonrails-talk-unsubscribe-/JYPxA39Uh5TLH3MbocFFw@public.gmane.org For more options, visit this group at http://groups.google.com/group/rubyonrails-talk?hl=en -~----------~----~----~----~------~----~------~--~---
dblack-TKXtfPMJ4Ozk1uMJSBkQmQ@public.gmane.org
2007-Jan-17 20:42 UTC
Re: Controllers without Models
Hi -- On Mon, 15 Jan 2007, shware1 wrote:> > Hi, > > Newbie here...Is it possible to create a controller without a model? > > Example: a CRM app has a "calendar" type of page. I''m thinking the URL > would be /calendar/action. There is no dedicated "calendar" table in > the d/b but rather a collection of calls, tasks, meetings, etc. Is it > as simple as creating a calendar controller? I''ve tried but keep > getting "recognition failed...".That''s got to be some other problem. You can definitely create controllers that aren''t named the same as models. Can you give more details about the error you''re getting? David -- Q. What is THE Ruby book for Rails developers? A. RUBY FOR RAILS by David A. Black (http://www.manning.com/black) (See what readers are saying! http://www.rubypal.com/r4rrevs.pdf) Q. Where can I get Ruby/Rails on-site training, consulting, coaching? A. Ruby Power and Light, LLC (http://www.rubypal.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 rubyonrails-talk-/JYPxA39Uh5TLH3MbocFFw@public.gmane.org To unsubscribe from this group, send email to rubyonrails-talk-unsubscribe-/JYPxA39Uh5TLH3MbocFFw@public.gmane.org For more options, visit this group at http://groups.google.com/group/rubyonrails-talk?hl=en -~----------~----~----~----~------~----~------~--~---
>> Example: a CRM app has a "calendar" type of page. I''m thinking the URL >> would be /calendar/action. There is no dedicated "calendar" table in >> the d/b but rather a collection of calls, tasks, meetings, etc. Is it >> as simple as creating a calendar controller? I''ve tried but keep...if all you care about is creating the URL /calendar/action, then you don''t need to even create a new controller ... you just need to set it in calander-rails-app/config/routes.rb to something like this: map.connect "/calendar/:action/:id", :controller => ''the-one-u-are-using'', :action => ''action'', :id => ''id'' or however else you want to configgg it. this will use the controller the-one-u-are-using.rb hih, s -- 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 rubyonrails-talk-/JYPxA39Uh5TLH3MbocFFw@public.gmane.org To unsubscribe from this group, send email to rubyonrails-talk-unsubscribe-/JYPxA39Uh5TLH3MbocFFw@public.gmane.org For more options, visit this group at http://groups.google.com/group/rubyonrails-talk?hl=en -~----------~----~----~----~------~----~------~--~---
Thanks for the responses. I was trying to createa a test controller and finally realized that it was a file naming issue (testcontroller.rb vs tests_controller.rb). More noob questions to follow in separate threads :) Thanks again! Shawn --~--~---------~--~----~------------~-------~--~----~ 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-/JYPxA39Uh5TLH3MbocFFw@public.gmane.org To unsubscribe from this group, send email to rubyonrails-talk-unsubscribe-/JYPxA39Uh5TLH3MbocFFw@public.gmane.org For more options, visit this group at http://groups.google.com/group/rubyonrails-talk?hl=en -~----------~----~----~----~------~----~------~--~---