In a sample app,we have one controller called employee_controller.This
one has its model and view parts.
Now can we create another controller(say,emp_controller,which
shouldn't have model or view parts) in such a way that one can access
all employee's methods through emp_controller.

That means,GET on http://server:3000/emp/{:id} would give same results
as a GET on http://server:3000/employee/{:id} would do?

Or,http://server:3000/emp/{:id}/skill/ would give same results as a
GET on http://server:3000/employee/{:id}/expertise/ would do?

[whereas emp is the controller mapping to employee and skill is the
controller mapping to expertise]

And I do not want to redirect to original urls(employee or employee/id/
expertise).
The new front-end urls with emp and skill controllers should be
sufficient to get tha data from original urls and show.

--
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+unsubscribe@googlegroups.com.
For more options, visit this group at http://groups.google.com/group/rubyonrails-talk?hl=en.

Search Discussions

  • Colin Law at Mar 28, 2012 at 12:06 pm

    On 28 March 2012 12:54, Pallav_bfs wrote:
    In a sample app,we have one controller called employee_controller.This
    one has its model and view parts.
    Now can we create another controller(say,emp_controller,which
    shouldn't have model or view parts) in such a way that one can access
    all employee's methods through emp_controller.

    That means,GET on http://server:3000/emp/{:id} would give same results
    as a GET on http://server:3000/employee/{:id} would do?

    Or,http://server:3000/emp/{:id}/skill/ would give same results as a
    GET on http://server:3000/employee/{:id}/expertise/ would do?
    Set up routes for those actions so that emp url goes to the
    appropriate employee controller actions.

    Colin

    --
    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+unsubscribe@googlegroups.com.
    For more options, visit this group at http://groups.google.com/group/rubyonrails-talk?hl=en.

Related Discussions

Discussion Navigation
viewthread | post
Discussion Overview
grouprubyonrails-talk @
categoriesrubyonrails
postedMar 28, '12 at 11:54a
activeMar 28, '12 at 12:06p
posts2
users2
websiterubyonrails.org
irc#RubyOnRails

2 users in discussion

Colin Law: 1 post Pallav_bfs: 1 post

People

Translate

site design / logo © 2021 Grokbase