My first app - administrating & routing concerns

Hello there fellow devs.

I’ve just decided to start with my first real-world app on Rails 3.2.
I’m a
newbie so go easy on me :P. Let me describe my app idea.

The app is a “Daily Offers” site, where visitors will be able to watch
the new offers that the “Vendors” will submit. Now the important part -
“Vendors”. ‘Vendors’ are in other words the people who paid to signup
my app and will be able to submit their ‘Offers’.

Here comes my first issue: implementing the admin control panel: I
to give these ‘Vendors’ a separate admin panel, where they will login
they’ll be able to manage their offers, see their stats and more. I know
it’s easier to implement front-end administration but the way I thought
in my case it feets better to have totally different views for

Now, after a search, I thought that using namespaced controllers and
would be a good idea (ex. Admin::MainPagesController etc). Isn’t it? And
then I’ll implement my authentication system (don’t want to use any gems
cause I want to practice and learn Rails) to restrict admins the ability
view-manage only their offers and not the offers of other admins. Do you
have any other suggestions on this issue? Is there another way to do it
other than namespacing the controllers and views?

*Second issue - routing: I believe how will I route depends on the urls
want to have, right? So I have 2 resources in my app, :vendors and *
. I decided to nest the offers resource inside vendors cause
the more natural way, an offer makes sense to be always precedenced by
vendor, isn’t it?

Some questions:

  1. I want to have URLs like instead
    *So I did it like this, seems to be working but I don’t know if it’s
    good practice or not:
  2. If later I want to add subdomains like
    (which would match to, could this be
    easily with the current routing I’m doing?
  3. Is this considered RESTful approach? I really want to do it the

Thanks in advance.

Can anyone give me some insight on this? I really don’t know how to do

Maybe I should start from implementing the front-end first and then get
with the back-end (eg. admin panel)?

Also another question I forgot. Right now, by namespacing the
I have a VendorsController with the index and show actions for the
visitors and then I will need to have another controller in the
namespace to provide ‘Vendors’ the ability to edit and update their info
(name,username,email etc). How should I do this? Add a VendorsController
with update and edit actions in the /controllers/admin/ folder? Or just
/controllers/vendors_controller.rb and restrict the actions to the

This forum is not affiliated to the Ruby language, Ruby on Rails framework, nor any Ruby applications discussed here.

| Privacy Policy | Terms of Service | Remote Ruby Jobs