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 all
the new offers that the "Vendors" will submit. Now the important part - the
"Vendors". 'Vendors' are in other words the people who paid to signup for
my app and will be able to submit their 'Offers'.

*Here comes my first issue:* implementing the admin control panel: I want
to give these 'Vendors' a separate admin panel, where they will login and
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 it,
in my case it feets better to have totally different views for
administrating.

Now, after a search, I thought that using namespaced controllers and views
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 to
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 I
want to have, right? So I have 2 resources in my app, *:vendors* and *
:offers*. I decided to nest the offers resource inside vendors cause that's
the more natural way, an offer makes sense to be always precedenced by it's
vendor, isn't it?

Some questions:

1. I want to have URLs like *example.com/v/<vendor username>* instead of*example.com/vendors/<vendor id>.
*So I did it like this, seems to be working but I don't know if it's a
good practice or not: https://gist.github.com/1949898
2. If later I want to add subdomains like <vendor username>.example.com
(which would match to example.com/v/<vendor username>), could this be done
easily with the current routing I'm doing?
3. Is this considered RESTful approach? I really want to do it the best
way.

Thanks in advance.

--
You received this message because you are subscribed to the Google Groups "Ruby on Rails: Talk" group.
To view this discussion on the web visit https://groups.google.com/d/msg/rubyonrails-talk/-/Vp3p00JP8RwJ.
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

  • Agis A. at Mar 1, 2012 at 1:51 pm
    Also another question I forgot. Right now, by namespacing the controllers,
    I have a VendorsController with the index and show actions for the public
    visitors and then I *will* need to have another controller in the Admin::
    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 use
    /controllers/vendors_controller.rb and restrict the actions to the Vendors?

    --
    You received this message because you are subscribed to the Google Groups "Ruby on Rails: Talk" group.
    To view this discussion on the web visit https://groups.google.com/d/msg/rubyonrails-talk/-/VGSzDLiC6Z0J.
    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.
  • Agis A. at Mar 2, 2012 at 12:00 am
    Can anyone give me some insight on this? I really don't know how to do this.

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


    --
    You received this message because you are subscribed to the Google Groups "Ruby on Rails: Talk" group.
    To view this discussion on the web visit https://groups.google.com/d/msg/rubyonrails-talk/-/Pqo0PzUIpTYJ.
    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 1, '12 at 1:44p
activeMar 2, '12 at 12:00a
posts3
users1
websiterubyonrails.org
irc#RubyOnRails

1 user in discussion

Agis A.: 3 posts

People

Translate

site design / logo © 2022 Grokbase