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 ;) -- Posted via http://www.ruby-forum.com/.
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 1/30/06, Davorin <davorin@zvpl.com> wrote:> 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 ;) > > -- > Posted via http://www.ruby-forum.com/. > _______________________________________________ > Rails mailing list > Rails@lists.rubyonrails.org > http://lists.rubyonrails.org/mailman/listinfo/rails >
Thanks for the idea! I''ve done everything except part 4., so I''d better get on with it ;) -- Posted via http://www.ruby-forum.com/.
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 -------------- next part -------------- An HTML attachment was scrubbed... URL: http://wrath.rubyonrails.org/pipermail/rails/attachments/20060130/3b916a9f/attachment-0001.html
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 :) -- Posted via http://www.ruby-forum.com/.
<% 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 1/31/06, Davorin Pavlica <davorin@zvpl.com> wrote:> 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 :) > > -- > Posted via http://www.ruby-forum.com/. > _______________________________________________ > Rails mailing list > Rails@lists.rubyonrails.org > http://lists.rubyonrails.org/mailman/listinfo/rails >
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 -- Posted via http://www.ruby-forum.com/.
... configure the application.rb something like: before_filter :require_login, :only => [ :list, :show ] ?!? -- Posted via http://www.ruby-forum.com/.
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] -- Posted via http://www.ruby-forum.com/.
... but I still don''t have a clue why "nil.title" in _post.rhtml?!?????????? -- Posted via http://www.ruby-forum.com/.
Download typo or Rforum and go thru their code. It will be more helpful On 1/31/06, Davorin Pavlica <davorin@zvpl.com> wrote:> > ... but I still don''t have a clue why "nil.title" in > _post.rhtml?!?????????? > > -- > Posted via http://www.ruby-forum.com/. > _______________________________________________ > Rails mailing list > Rails@lists.rubyonrails.org > http://lists.rubyonrails.org/mailman/listinfo/rails >-- Rgds, --Siva Jagadeesan http://www.varcasa.com/ My First Rails Project. Powered by Typo and soon by RForum too -------------- next part -------------- An HTML attachment was scrubbed... URL: http://wrath.rubyonrails.org/pipermail/rails/attachments/20060131/01e2c4b0/attachment.html
http://en.wikipedia.org/wiki/Cargo_cult On 1/30/06, Michael Trier <mtrier@gmail.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 Jan 31, 2006, at 2:46 PM, Tobias Luetke wrote:> http://en.wikipedia.org/wiki/Cargo_cult > > On 1/30/06, Michael Trier <mtrier@gmail.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 > _______________________________________________ > Rails mailing list > Rails@lists.rubyonrails.org > http://lists.rubyonrails.org/mailman/listinfo/rails >lol @ Tobi Cheers- -Ezra Zygmuntowicz Yakima Herald-Republic WebMaster http://yakimaherald.com 509-577-7732 ezra@yakima-herald.com
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 1/31/06, Davorin Pavlica <davorin@zvpl.com> wrote:> > 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 :) > > -- > Posted via http://www.ruby-forum.com/. > _______________________________________________ > Rails mailing list > Rails@lists.rubyonrails.org > http://lists.rubyonrails.org/mailman/listinfo/rails >-------------- next part -------------- An HTML attachment was scrubbed... URL: http://wrath.rubyonrails.org/pipermail/rails/attachments/20060201/c5876239/attachment-0001.html
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). -- Posted via http://www.ruby-forum.com/.