The right Rails 2.1 way of doing things

Some of the answers to the question I had about redirect_to made me think of some other questions.

I mainly write a blog application using Rails 2.1. I myself tried to do most of this (as I know a few rails), but with reference to textbooks and links on the Internet when I need it.

I managed to get a simple blog, but I tried to add comments. I myself was able to bring it to a scene where I could add comments from script/console, but I could not get a form for work.

In one of the tutorials that I followed, it was suggested to create a β€œcomment” in the message controller, which adds a comment. My question is: is this a "standard" way to do this? One of the answers to my other question seemed to suggest that the comment should be involved. The controller ... should it be?

I managed to solve the problem that I asked in my other question, but it bothers me a bit that I am just doing dirty fast hacks and not programming the rails.

+5
source share
1 answer

The preferred Rails approach now uses the RESTful style, which means you will have a Post resource and a Comment resource, and yes, this implies a separate controller for comments.

, Softies on Rails, , . , .NET, Rails, !

+9

All Articles