1. I have a text area in which I type on multiple lines..but when I display it, it prints whole text in one line..how can I solve that? Datatype is TEXT 2. I can see a list of all posts at ..post/ with index method but I want to see a particular post with ..post/[id] .. how can I do that? 3. I want my application to be completely secured and whatever page unlogged in user tries to open, it should redirect to :controller => ''user'', :action => ''login'' ... some before_filter maybe but I dont know where to put that to secure all of the application. 4. How to display a column of options from a table into a drop down list, with id being their value.? Thanks in advance -- Posted via http://www.ruby-forum.com/. --~--~---------~--~----~------------~-------~--~----~ You received this message because you are subscribed to the Google Groups "Ruby on Rails: Talk" group. To post to this group, send email to rubyonrails-talk-/JYPxA39Uh5TLH3MbocFFw@public.gmane.org To unsubscribe from this group, send email to rubyonrails-talk-unsubscribe-/JYPxA39Uh5TLH3MbocFFw@public.gmane.org For more options, visit this group at http://groups.google.com/group/rubyonrails-talk?hl=en -~----------~----~----~----~------~----~------~--~---
rein.henrichs-Re5JQEeQqe8AvxtiuMwx3w@public.gmane.org
2007-Sep-03 06:29 UTC
Re: Some basic questions
1) HTML ignores whitespace unless it''s inside a <pre> tag or you change the CSS whitespace property. I would recommend formatting the text field for display with simple_format(text). Read about it here: http://api.rubyonrails.org/classes/ActionView/Helpers/TextHelper.html#M000623 2) In your index action in the controller, add @post Post.find(params[:id]) if params[:id] and pass the id of the post you want in the params 3) Use the login_required method in the authenticated_system.rb of restful_authentication (or acts_as_authenticated) as a before_ftiler or model yours after it. See the restful_authentication documentation. 4) Sorry, not following you here. On Sep 3, 1:16 am, Vapor Rails <rails-mailing-l...-ARtvInVfO7ksV2N9l4h3zg@public.gmane.org> wrote:> 1. I have a text area in which I type on multiple lines..but when I > display it, it prints whole text in one line..how can I solve that? > Datatype is TEXT > > 2. I can see a list of all posts at ..post/ with index method but I want > to see a particular post with ..post/[id] .. how can I do that? > > 3. I want my application to be completely secured and whatever page > unlogged in user tries to open, it should redirect to :controller => > ''user'', :action => ''login'' ... some before_filter maybe but I dont know > where to put that to secure all of the application. > > 4. How to display a column of options from a table into a drop down > list, with id being their value.? > > Thanks in advance > -- > Posted viahttp://www.ruby-forum.com/.--~--~---------~--~----~------------~-------~--~----~ You received this message because you are subscribed to the Google Groups "Ruby on Rails: Talk" group. To post to this group, send email to rubyonrails-talk-/JYPxA39Uh5TLH3MbocFFw@public.gmane.org To unsubscribe from this group, send email to rubyonrails-talk-unsubscribe-/JYPxA39Uh5TLH3MbocFFw@public.gmane.org For more options, visit this group at http://groups.google.com/group/rubyonrails-talk?hl=en -~----------~----~----~----~------~----~------~--~---
unknown wrote:> 4) Sorry, not following you here.like I have a table called statuses and in there I have some columns including id and status_name I want to get all the ids and status_names and display them in drop down list with status_names being displayed in drop down but when submitted value being the ids sent to database. I hope it makes sense -- Posted via http://www.ruby-forum.com/. --~--~---------~--~----~------------~-------~--~----~ You received this message because you are subscribed to the Google Groups "Ruby on Rails: Talk" group. To post to this group, send email to rubyonrails-talk-/JYPxA39Uh5TLH3MbocFFw@public.gmane.org To unsubscribe from this group, send email to rubyonrails-talk-unsubscribe-/JYPxA39Uh5TLH3MbocFFw@public.gmane.org For more options, visit this group at http://groups.google.com/group/rubyonrails-talk?hl=en -~----------~----~----~----~------~----~------~--~---
unknown wrote:> 3) Use the login_required method in the authenticated_system.rb of > restful_authentication (or acts_as_authenticated) as a before_ftiler > or model yours after it. See the restful_authentication documentation.that is some kind of plugin..could you please give link to some tutorial on how to use that because I learned user authentication just a couple of hours ago -- Posted via http://www.ruby-forum.com/. --~--~---------~--~----~------------~-------~--~----~ You received this message because you are subscribed to the Google Groups "Ruby on Rails: Talk" group. To post to this group, send email to rubyonrails-talk-/JYPxA39Uh5TLH3MbocFFw@public.gmane.org To unsubscribe from this group, send email to rubyonrails-talk-unsubscribe-/JYPxA39Uh5TLH3MbocFFw@public.gmane.org For more options, visit this group at http://groups.google.com/group/rubyonrails-talk?hl=en -~----------~----~----~----~------~----~------~--~---
> 2) In your index action in the controller, add @post > Post.find(params[:id]) if params[:id] and pass the id of the post you > want in the paramsIt says Unknown action No action responded to 4 :S -- Posted via http://www.ruby-forum.com/. --~--~---------~--~----~------------~-------~--~----~ You received this message because you are subscribed to the Google Groups "Ruby on Rails: Talk" group. To post to this group, send email to rubyonrails-talk-/JYPxA39Uh5TLH3MbocFFw@public.gmane.org To unsubscribe from this group, send email to rubyonrails-talk-unsubscribe-/JYPxA39Uh5TLH3MbocFFw@public.gmane.org For more options, visit this group at http://groups.google.com/group/rubyonrails-talk?hl=en -~----------~----~----~----~------~----~------~--~---
rein.henrichs-Re5JQEeQqe8AvxtiuMwx3w@public.gmane.org
2007-Sep-03 06:51 UTC
Re: Some basic questions
I would definitely suggest that you familiarize yourself with the basic concept of user authentication in rails before you start using a plugin (so that you understand what the plugin does). The Agile Web Dev. with Rails book has a user authentication section that goes over it briefly. The restful_authentication plugin itself has excellent README and RDoc documentation and the code is quite easy to follow as well, so you may want to check it out. (the plugin is in technoweenie''s plugin repository, google should find it for you easily, and there are various resources online that can help you integrate it, including a wiki for the original acts_as_authenticated plugin) 4) check api.rubyonrails.org for the collection_select form helper. On Sep 3, 1:42 am, Vapor Rails <rails-mailing-l...-ARtvInVfO7ksV2N9l4h3zg@public.gmane.org> wrote:> unknown wrote: > > 3) Use the login_required method in the authenticated_system.rb of > > restful_authentication (or acts_as_authenticated) as a before_ftiler > > or model yours after it. See the restful_authentication documentation. > > that is some kind of plugin..could you please give link to some tutorial > on how to use that because I learned user authentication just a couple > of hours ago > > -- > Posted viahttp://www.ruby-forum.com/.--~--~---------~--~----~------------~-------~--~----~ You received this message because you are subscribed to the Google Groups "Ruby on Rails: Talk" group. To post to this group, send email to rubyonrails-talk-/JYPxA39Uh5TLH3MbocFFw@public.gmane.org To unsubscribe from this group, send email to rubyonrails-talk-unsubscribe-/JYPxA39Uh5TLH3MbocFFw@public.gmane.org For more options, visit this group at http://groups.google.com/group/rubyonrails-talk?hl=en -~----------~----~----~----~------~----~------~--~---
Vapor Rails wrote:>> 2) In your index action in the controller, add @post >> Post.find(params[:id]) if params[:id] and pass the id of the post you >> want in the params >> > > It says > > Unknown action > No action responded to 4 > > :S >Sounds like your routes.rb has been screwed up. post the contents. /path/to/project/config/routes.rb --~--~---------~--~----~------------~-------~--~----~ You received this message because you are subscribed to the Google Groups "Ruby on Rails: Talk" group. To post to this group, send email to rubyonrails-talk-/JYPxA39Uh5TLH3MbocFFw@public.gmane.org To unsubscribe from this group, send email to rubyonrails-talk-unsubscribe-/JYPxA39Uh5TLH3MbocFFw@public.gmane.org For more options, visit this group at http://groups.google.com/group/rubyonrails-talk?hl=en -~----------~----~----~----~------~----~------~--~---
Anthony Richardson wrote:> Sounds like your routes.rb has been screwed up. post the contents. > > /path/to/project/config/routes.rbActionController::Routing::Routes.draw do |map| map.connect '':controller/service.wsdl'', :action => ''wsdl'' map.connect '':controller/:action/:id.:format'' map.connect '':controller/:action/:id'' end -- Posted via http://www.ruby-forum.com/. --~--~---------~--~----~------------~-------~--~----~ You received this message because you are subscribed to the Google Groups "Ruby on Rails: Talk" group. To post to this group, send email to rubyonrails-talk-/JYPxA39Uh5TLH3MbocFFw@public.gmane.org To unsubscribe from this group, send email to rubyonrails-talk-unsubscribe-/JYPxA39Uh5TLH3MbocFFw@public.gmane.org For more options, visit this group at http://groups.google.com/group/rubyonrails-talk?hl=en -~----------~----~----~----~------~----~------~--~---
rein.henrichs-Re5JQEeQqe8AvxtiuMwx3w@public.gmane.org
2007-Sep-03 07:00 UTC
Re: Some basic questions
It sounds like his get params are fubared. 4 is probably the id he wants but he''s put it in the action param instead. Of course 4 could also be the id of nil, but we''ve got whiny nils to prevent that confusion. On Sep 3, 1:56 am, Vapor Rails <rails-mailing-l...-ARtvInVfO7ksV2N9l4h3zg@public.gmane.org> wrote:> Anthony Richardson wrote: > > Sounds like your routes.rb has been screwed up. post the contents. > > > /path/to/project/config/routes.rb > > ActionController::Routing::Routes.draw do |map| > map.connect '':controller/service.wsdl'', :action => ''wsdl'' > map.connect '':controller/:action/:id.:format'' > map.connect '':controller/:action/:id'' > end > -- > Posted viahttp://www.ruby-forum.com/.--~--~---------~--~----~------------~-------~--~----~ You received this message because you are subscribed to the Google Groups "Ruby on Rails: Talk" group. To post to this group, send email to rubyonrails-talk-/JYPxA39Uh5TLH3MbocFFw@public.gmane.org To unsubscribe from this group, send email to rubyonrails-talk-unsubscribe-/JYPxA39Uh5TLH3MbocFFw@public.gmane.org For more options, visit this group at http://groups.google.com/group/rubyonrails-talk?hl=en -~----------~----~----~----~------~----~------~--~---
Vapor Rails wrote:> ActionController::Routing::Routes.draw do |map| > map.connect '':controller/service.wsdl'', :action => ''wsdl'' > map.connect '':controller/:action/:id.:format'' > map.connect '':controller/:action/:id'' > end >Looks OK. What URL are you using? http://<host>/<controller>/<action>/<id> examples: http://localhost:3000/post/show/4 if you want to do http://localhost:3000/post/4 you need to change your routes and controller to suit. I would recommend looking into usig REST instead of the standard rails generator code. --~--~---------~--~----~------------~-------~--~----~ You received this message because you are subscribed to the Google Groups "Ruby on Rails: Talk" group. To post to this group, send email to rubyonrails-talk-/JYPxA39Uh5TLH3MbocFFw@public.gmane.org To unsubscribe from this group, send email to rubyonrails-talk-unsubscribe-/JYPxA39Uh5TLH3MbocFFw@public.gmane.org For more options, visit this group at http://groups.google.com/group/rubyonrails-talk?hl=en -~----------~----~----~----~------~----~------~--~---
Anthony Richardson wrote:> Looks OK. What URL are you using? > > http://<host>/<controller>/<action>/<id> > > examples: > http://localhost:3000/post/show/4 > > if you want to do > http://localhost:3000/post/4 > > you need to change your routes and controller to suit. I would recommend > looking into usig REST instead of the standard rails generator code.currently I am using http://localhost:3000/post/show/4 but i want to use http://localhost:3000/post/4 dont know about REST or something..n00b :( -- Posted via http://www.ruby-forum.com/. --~--~---------~--~----~------------~-------~--~----~ You received this message because you are subscribed to the Google Groups "Ruby on Rails: Talk" group. To post to this group, send email to rubyonrails-talk-/JYPxA39Uh5TLH3MbocFFw@public.gmane.org To unsubscribe from this group, send email to rubyonrails-talk-unsubscribe-/JYPxA39Uh5TLH3MbocFFw@public.gmane.org For more options, visit this group at http://groups.google.com/group/rubyonrails-talk?hl=en -~----------~----~----~----~------~----~------~--~---
rein.henrichs-Re5JQEeQqe8AvxtiuMwx3w@public.gmane.org
2007-Sep-03 07:27 UTC
Re: Some basic questions
Default rails routing is :controller/:action/:id which means that http://localhost:3000/post/4 gives the params { :controller => ''post'', :action => ''4'', :id => nil } You want params like { :controller => ''post'', :action => ''index'', :id => ''4'' } So your link would be http://localhost:3000/post/index/4 Ideally you would be using link_to to create this link. As an aside, it may make more sense to make this a show action that also lists the posts rather than an index action that also shows a post. On Sep 3, 2:17 am, Vapor Rails <rails-mailing-l...-ARtvInVfO7ksV2N9l4h3zg@public.gmane.org> wrote:> Anthony Richardson wrote: > > Looks OK. What URL are you using? > > > http://<host>/<controller>/<action>/<id> > > > examples: > > http://localhost:3000/post/show/4 > > > if you want to do > > http://localhost:3000/post/4 > > > you need to change your routes and controller to suit. I would recommend > > looking into usig REST instead of the standard rails generator code. > > currently I am usinghttp://localhost:3000/post/show/4but i want to usehttp://localhost:3000/post/4 > > dont know about REST or something..n00b :( > -- > Posted viahttp://www.ruby-forum.com/.--~--~---------~--~----~------------~-------~--~----~ You received this message because you are subscribed to the Google Groups "Ruby on Rails: Talk" group. To post to this group, send email to rubyonrails-talk-/JYPxA39Uh5TLH3MbocFFw@public.gmane.org To unsubscribe from this group, send email to rubyonrails-talk-unsubscribe-/JYPxA39Uh5TLH3MbocFFw@public.gmane.org For more options, visit this group at http://groups.google.com/group/rubyonrails-talk?hl=en -~----------~----~----~----~------~----~------~--~---
Vapor Rails wrote:> currently I am using http://localhost:3000/post/show/4 but i want to use > http://localhost:3000/post/4 > > dont know about REST or something..n00b :( >I found this PDF http://www.rubyinside.com/restful-rails-development-pdf-released-392.html and the 2006 keynote by DHH http://www.scribemedia.org/2006/07/09/dhh/ was all I needed to get started. --~--~---------~--~----~------------~-------~--~----~ You received this message because you are subscribed to the Google Groups "Ruby on Rails: Talk" group. To post to this group, send email to rubyonrails-talk-/JYPxA39Uh5TLH3MbocFFw@public.gmane.org To unsubscribe from this group, send email to rubyonrails-talk-unsubscribe-/JYPxA39Uh5TLH3MbocFFw@public.gmane.org For more options, visit this group at http://groups.google.com/group/rubyonrails-talk?hl=en -~----------~----~----~----~------~----~------~--~---
Anthony Richardson wrote:> Vapor Rails wrote: >> currently I am using http://localhost:3000/post/show/4 but i want to use >> http://localhost:3000/post/4 >> >> dont know about REST or something..n00b :( >> > I found this PDF > http://www.rubyinside.com/restful-rails-development-pdf-released-392.html > and the 2006 keynote by DHH http://www.scribemedia.org/2006/07/09/dhh/ > was all I needed to get started.thanks Anthony :) -- Posted via http://www.ruby-forum.com/. --~--~---------~--~----~------------~-------~--~----~ You received this message because you are subscribed to the Google Groups "Ruby on Rails: Talk" group. To post to this group, send email to rubyonrails-talk-/JYPxA39Uh5TLH3MbocFFw@public.gmane.org To unsubscribe from this group, send email to rubyonrails-talk-unsubscribe-/JYPxA39Uh5TLH3MbocFFw@public.gmane.org For more options, visit this group at http://groups.google.com/group/rubyonrails-talk?hl=en -~----------~----~----~----~------~----~------~--~---
Reasonably Related Threads
- Facebooker and existing website?
- Restful Authentication Uninitialized Constant in Production...
- Object.stubs doesn''t seem to work.
- Modifying the restful_authentication plugin / Classes creating instances of themselves.
- Where can I get "authenticate_with_http_basic"?