Account Options

  1. Sign in
The old Google Groups will be going away soon, but your browser is incompatible with the new version.
Google Groups Home
« Groups Home
Just getting started. Don't understand a thing.
There are currently too many topics in this group that display first. To make this topic appear first, remove this option from another topic.
There was an error processing your request. Please try again.
flag
  3 messages - Collapse all  -  Translate all to Translated (View all originals)
The group you are posting to is a Usenet group. Messages posted to this group will make your email address visible to anyone on the Internet.
Your reply message has not been sent.
Your post was successful
 
From:
To:
Cc:
Followup To:
Add Cc | Add Followup-to | Edit Subject
Subject:
Validation:
For verification purposes please type the characters you see in the picture below or the numbers you hear by clicking the accessibility icon. Listen and type the numbers you hear
 
Baruch Atta  
View profile  
 More options Oct 18 2012, 10:26 pm
From: Baruch Atta <barucha...@gmail.com>
Date: Thu, 18 Oct 2012 19:26:48 -0700 (PDT)
Local: Thurs, Oct 18 2012 10:26 pm
Subject: Just getting started. Don't understand a thing.

Reading the fine manual, I am doing the tasks in order:  I got to 4.3 and
hit a wall.
"The root :to => "home#index" tells Rails to map the root..."
In any operating system that I have used, home#index is not a path.  I want
to route to the path C:\Documents and Settings\Baruch\blog>  where i
created my "blog" first application as listed in the fine manual. This step
4.3 (I would think) is telling me that I can list my blog folder as the
root of my application and it will be used as the index.htm root folder. My
question is How do I actually "root" to my "blog" folder?
My observation is Why doesn't the fine manual actually tell me this, at
this point?

Page copied for reference below....4.3 Setting the Application Home Page

Now that we have made the controller and view, we need to tell Rails when
we want “Hello Rails!” to show up. In our case, we want it to show up when
we navigate to the root URL of our site,http://localhost:3000, instead of
the “Welcome Aboard” smoke test.

The first step to doing this is to delete the default page from your
application:
$ rm public/index.html

We need to do this as Rails will deliver any static file in the public directory
in preference to any dynamic content we generate from the controllers.

Now, you have to tell Rails where your actual home page is located. Open
the fileconfig/routes.rb in your editor. This is your application’s *routing
file* which holds entries in a special DSL (domain-specific language) that
tells Rails how to connect incoming requests to controllers and actions.
This file contains many sample routes on commented lines, and one of them
actually shows you how to connect the root of your site to a specific
controller and action. Find the line beginning with root :to and uncomment
it. It should look something like the following:
Blog::Application.routes.draw do

  #...
  # You can have the root of your site routed with "root"
  # just remember to delete public/index.html.
  root :to => "home#index"
The root :to => "home#index" tells Rails to map the root action to the home
controller’s index action.


 
You must Sign in before you can post messages.
To post a message you must first join this group.
Please update your nickname on the subscription settings page before posting.
You do not have the permission required to post.
Rodrigo Rosenfeld Rosas  
View profile  
 More options Oct 19 2012, 2:58 pm
From: Rodrigo Rosenfeld Rosas <rr.ro...@gmail.com>
Date: Fri, 19 Oct 2012 15:58:14 -0300
Local: Fri, Oct 19 2012 2:58 pm
Subject: Re: [Rails-docs] Just getting started. Don't understand a thing.

Em 18-10-2012 23:26, Baruch Atta escreveu:

> Reading the fine manual, I am doing the tasks in order:  I got to 4.3
> and hit a wall.

>         "Theroot :to => "home#index"tells Rails to map the root..."

To map the root path ("/"), not your project root.


 
You must Sign in before you can post messages.
To post a message you must first join this group.
Please update your nickname on the subscription settings page before posting.
You do not have the permission required to post.
Robb Shecter  
View profile  
 More options Nov 7 2012, 4:04 pm
From: Robb Shecter <r...@weblaws.org>
Date: Wed, 7 Nov 2012 13:04:00 -0800 (PST)
Subject: Re: Just getting started. Don't understand a thing.

On Thursday, October 18, 2012 7:26:49 PM UTC-7, Baruch Atta wrote:

> Reading the fine manual, I am doing the tasks in order:  I got to 4.3 and
> hit a wall.
> "The root :to => "home#index" tells Rails to map the root..."

I realize this is an old post, but I think that this is valuable feedback.
In the quoted page, I see that the text could be clearer:

> Now, you have to tell Rails where your actual home page is located.

This is actually not accurate. What we're doing is telling Rails which
controller and action will serve the home page. And that distinction is the
core of Baruch's confusion. I'll submit a change.

 
You must Sign in before you can post messages.
To post a message you must first join this group.
Please update your nickname on the subscription settings page before posting.
You do not have the permission required to post.
End of messages
« Back to Discussions « Newer topic     Older topic »