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.
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.
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:
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 (Ruby for Rails)
(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)