Saturday, March 5, 2011

[Rails] Re: Problem with generating view

On Mar 5, 10:53 am, Manny 777 <li...@ruby-forum.com> wrote:
> Hello,
>  I'm using Rails 3 and when I run this command:
>
> rails generate controller Todos2
>
> So I get new controller called Todos2 and in file todos2_controller.rb I
> will creating two view, index and about. (+ of course I'll creating
> appropriately views *.rhtml). Then when I type localhost:3000/todos -
> problem with routing, localhost:3000/todos/index - the same,
> localhost:3000/todos/about - the same
>
> When I used Rails v2.3.4, I rebooted server and everything worked. But
> now, I'm using Rails 3 and unfortunately nothing.
>
> And so: when creating controller and I'm typing:
>
> rails generate controller Todos2 index2, about2
>
> So both of views are created automatically and it seems work.
>
> So I would like to ask you -- in Rails 3 is not possible to create views
> manually, only with using command?

Probably because in a newly created rails 3 app the legacy default
routes aren't enabled by default. Looks like the generator will setup
the routes for you but if you're adding the extra actions yourself
then you'll have to add them to your routes file too.

Fred
>
> Thanks a lot,
> M.
>
> --
> 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@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.

0 Comments:

Post a Comment

Subscribe to Post Comments [Atom]

<< Home


Real Estate