I'm preety new at RoR (and programming), I tried a few tutorials, and really like the RoR simplicity, but my knowledge of the framework still isn't very good (to be true, i understand the basics, but not everything that's in the tutorials). But still I'd like to create a website which has: - front end interface (with no edit functions) - admin interface (with edit functions for articles, pictures, etc, ...) I'm interested if there are any similar systems "on the market", any tutorials, or any hints for a total n00b ;)
on 2006-01-30 11:20
on 2006-01-30 11:32
Most any Rails tutorial will cover scaffolding. This provides all your CRUD operations. To prevent users from doing anything other than viewing the items, you can just use some authentication and protect the admin actions. Look into the login_generator, instructions are on the wiki. So basic steps are 1. Create Rails app 2. Create database and table for your model 3. Generate scaffolding for your model 4. Install login_generator and protect your controller, except for the list/show actions There are many other authentication systems, and you can write your own of course, but if you just want to quickly put up a site to do that, those are the steps you need to take to just get started learning. Pat
on 2006-01-30 12:00
Thanks for the idea! I've done everything except part 4., so I'd better get on with it ;)
on 2006-01-30 16:17
I would recommend you look at the login_engine, over the direct login_generator. For someone starting out I found the login_engine pretty easy to implement. Not to say you shouldn't look at them both, but I found the login_engine and the associated tutorial videos to be extremely helpful. Michael Trier
on 2006-01-31 10:36
Basicly what I want to do is that Pat Maddox's #4, but just can't understand how to disable edit functions ... For examlpe: the part of the code: (<%= link_to 'Edit', :action => 'edit', :id => post %>) has to be invisible to unregistered users. But how to do it ... that's a big problem in my designer brain :)
on 2006-01-31 12:19
<% unless session[:user].nil? %> <%= link_to 'Edit', :action => 'edit', :id => post %> <% end %> Whenever a user is logged in, he will see the link. When he's not logged in, he won't. Also you should ensure that you use before_filter to protect the admin methods. Pat
on 2006-01-31 14:58
Thx! This works superb ... in 'list', 'edit' all except 'show' ... in show.rhtml i have a render partial funcion <%= render :partial => "post", :object => @post %> and in _post there is an error no line #2 <%= link_to post.title, :action => 'show', :id => post %> ... ... and the error is: NoMethodError in Blog#show Showing app/views/blog/_post.rhtml where line #2 raised: You have a nil object when you didn't expect it! The error occured while evaluating nil.title I suppose I should configure tle
on 2006-01-31 15:14
... configure the application.rb something like: before_filter :require_login, :only => [ :list, :show ] ?!?
on 2006-01-31 18:52
Davorin Pavlica wrote: > ... configure the application.rb something like: > > before_filter :require_login, :only => [ :list, :show ] ?!? I figured that one out ... in blog_controller i have to define required login ... before_filter :login_required, :only => [:edit, :destroy]
on 2006-01-31 18:53
... but I still don't have a clue why "nil.title" in _post.rhtml?!??????????
on 2006-01-31 21:53
Download typo or Rforum and go thru their code. It will be more helpful On 1/31/06, Davorin Pavlica <firstname.lastname@example.org> wrote: > -- Rgds, --Siva Jagadeesan http://www.varcasa.com/ My First Rails Project. Powered by Typo and soon by RForum too
on 2006-01-31 23:48
http://en.wikipedia.org/wiki/Cargo_cult On 1/30/06, Michael Trier <email@example.com> wrote: > I would recommend you look at the login_engine, over the direct > login_generator. For someone starting out I found the login_engine pretty > easy to implement. Not to say you shouldn't look at them both, but I found > the login_engine and the associated tutorial videos to be extremely helpful. -- Tobi http://jadedpixel.com - modern e-commerce software http://typo.leetsoft.com - Open source weblog engine http://blog.leetsoft.com - Technical weblog
on 2006-02-01 00:42
On Jan 31, 2006, at 2:46 PM, Tobias Luetke wrote: > > lol @ Tobi Cheers- -Ezra Zygmuntowicz Yakima Herald-Republic WebMaster http://yakimaherald.com 509-577-7732 firstname.lastname@example.org
on 2006-02-01 20:44
If you follow along with the tutorial in DHH's Rails book, it goes about doing just this. It uses two controllers to provide the admin & end-user functionality separation.
on 2006-02-02 08:15
Davorin Pavlica wrote: > ... but I still don't have a clue why "nil.title" in > _post.rhtml?!?????????? Thx, I figured it out ... I had a show.rhtml viewer, but no show action in blog_controller ... I just did def new @post = Post.new end in blog_controller, and it works. To do list: - make damn css and image linking work - module for links, categoris, advanced user system and managing, - file upload (multiple), auto resize, autocrop ... Miles to go before I sleep (you musn't forget, I'm just a web designer with very little experience in programming at al).