Ruby on Rails Tuesday, August 2, 2011

Here is a guide to create a blog:



The development model is different than asp.net. There aren't any controls. In case of the repeater, you iterate over the collection. Very rough sample code 

Controller:

def index
   @posts = Post.all
   # This fetches all posts and stores it in an instance variable named posts
end

in your view you iterate over this:

@posts.each do | post|
  <%= post.message %>   

This iterates over each element of posts and prints the message. Obviously you want do adorn this with the correct html elements.

And I agree that jump starting into a simple project is the best way of doing it. You will also want to look into rubygems.org

PS: The first week will be tough, but then you will see a sudden rise in productivity.


On Tue, Aug 2, 2011 at 2:00 AM, 7stud -- <lists@ruby-forum.com> wrote:
Rails is too complicated. The typical way to learn rails is to copy an
app out of a book, and you will have very little understanding of what
is going on--especially if you don't know ruby at an intermediate level.

--
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@googlegroups.com.
To unsubscribe from this group, send email to rubyonrails-talk+unsubscribe@googlegroups.com.
For more options, visit this group at http://groups.google.com/group/rubyonrails-talk?hl=en.



--
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@googlegroups.com.
To unsubscribe from this group, send email to rubyonrails-talk+unsubscribe@googlegroups.com.
For more options, visit this group at http://groups.google.com/group/rubyonrails-talk?hl=en.

No comments:

Post a Comment