Hi, I''m learning rails. Just started some month ago. I''ve got some years of experience with php and now I''ve realized rails makes a lot more fun. But anyways, I have a question. There is something I don''t understand. How would you do a rails app like this? Admin section: a cool rails app for CRUD of some I call them documents (i.e. document model) and for setting some parameters and so on Public (LAN) site: another cool rails app mostly for navigating within the document repository and for writing comments and so on Is there a straight rails way to do this? I mean I don''t want to have redundancies in code or other design mistakes. Should there be two separate apps or only one? And how to separate the two sections for security reasons while linking them by the models for design reasons? Thanks for all interesting replies!
Hi Klaus, I guess you are talking about setting up an admin section for maintenance of the docs and one section for publi viewing of the docs, I guess a way to do this is to set up an admin area (by designating a folder called admin within your application) - then put th controllers, models for the admin section inside this folder. you can even have same name models/ controllers as the public site inside this folder. Not sure if this is what you asked for - but maybe it will help. D On Aug 4, 4:39 pm, Klaus <klaus.niem...-gM/Ye1E23mwN+BqQ9rBEUg@public.gmane.org> wrote:> Hi, > > I''m learning rails. Just started some month ago. I''ve got some years > of experience with php and now I''ve realized rails makes a lot more > fun. > > But anyways, I have a question. There is something I don''t understand. > > How would you do a rails app like this? > Admin section: a cool rails app for CRUD of some I call them documents > (i.e. document model) and for setting some parameters and so on > Public (LAN) site: another cool rails app mostly for navigating within > the document repository and for writing comments and so on > > Is there a straight rails way to do this? I mean I don''t want to have > redundancies in code or other design mistakes. > > Should there be two separate apps or only one? And how to separate the > two sections for security reasons while linking them by the models for > design reasons? > > Thanks for all interesting replies!
That''s not what I''m looking for. I''m looking for a DRY solution. At least the document model should not repeat. On 4 Aug., 23:09, thumbrule <thematri...-Re5JQEeQqe8AvxtiuMwx3w@public.gmane.org> wrote:> I guess a way to do this is to set up an admin area (by designating a > folder called admin within your application) - then put th > controllers, models for the admin section inside this folder. you can > even have same name models/ controllers as the public site inside this > folder. > > Not sure if this is what you asked for - but maybe it will help.
On Aug 4, 2009, at 2:18 PM, Klaus wrote:> > That''s not what I''m looking for. > I''m looking for a DRY solution. > At least the document model should not repeat.It''s close. Just create a set of controllers/views for your admin stuff. I tend to put them into app/controllers/admin and app/views/ admin. Then this all gets password protected. I use the same models that the public facing website uses that live in app/models. This is DRY in the sense that (presumabely) what you are doing in the admin section is quite different than what the public can do. If you want to blend them all together you''re free to do that too. All depends on what makes the most sense for your app.> On 4 Aug., 23:09, thumbrule <thematri...-Re5JQEeQqe8AvxtiuMwx3w@public.gmane.org> wrote: >> I guess a way to do this is to set up an admin area (by designating a >> folder called admin within your application) - then put th >> controllers, models for the admin section inside this folder. you can >> even have same name models/ controllers as the public site inside >> this >> folder. >> >> Not sure if this is what you asked for - but maybe it will help. > > >
On 4 Aug., 23:34, Philip Hallstrom <phi...-LSG90OXdqQE@public.gmane.org> wrote:> It''s close. Just create a set of controllers/views for your admin > stuff. I tend to put them into app/controllers/admin and app/views/ > admin. Then this all gets password protected. > > I use the same models that the public facing website uses that live in > app/models. > > This is DRY in the sense that (presumabely) what you are doing in the > admin section is quite different than what the public can do. >And there are no problems to expect this way? I want to create a subdomain with a route to the admin section. I''ve already tested the ssl and subdomain things in rails, they''re looking great. Back to my first question: Is this the only recommandable way to build an admin section? Is it possible to create two apps and one is "linked" to the other? What I mean is: The public app would use some things (like models) from the admin app, and all rails magic would be available.