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:

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.

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.

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

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.

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.

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.

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 :frowning:   

I found this PDF RESTful Rails Development PDF Released and the 2006 keynote by DHH http://www.scribemedia.org/2006/07/09/dhh/ was all I needed to get started.