Re: Ubuntu & Rails, can''t get it to work

Phlip
Fri, 14 Mar 2008 14:55:14 -0000

[net note: don''t put "Re:" on a Subject. Only a reply should
have one.]

comopasta Gr wrote:

> I''m using now Ubuntu 7.10 (on WMware Player).

Good! The more Ubuntu in your life, the better. And write unit tests for all
your code. They help everything, including portability. You should have a batch
of tests that pass in both Windows and Ubuntu.

But beyond that, I don''t have an answer; just augmentations to your
questions!

 > And I think I get the same
> problems as you guys. Has anyone found a solution?
>
> Here''s my symptoms:
>
> When creating a test application and running it with WEbrick I get the
> next error:
>
> You have a nil object when you didn''t expect it!
> The error occurred while evaluating nil.to_sym
>
> The problematic lines are:
>
> <%= link_to ''Edit'', edit_coches_path(coches) %>
> <%= link_to ''Destroy'', coches, :confirm =>
''Are you sure?'', :method =>
> :delete %>
> <%= link_to ''New coches'', new_coches_path %>
>
> When those are substituted with:
>
> <%= link_to ''Edit'',
:controller=>"coches", :action=>"edit", :id=>coches

shouldn''t that be coches.id?

> %>
> <%= link_to ''Destroy'', :confirm => ''Are
you sure?'',
> :controller=>"coches", :action=>"destroy",
:id=>coches  %>
> <%=link_to ''New coches'',
{:controller=>"coches", :action=>"new"} %>
>
> Then it seems to be working ok.
>
> The routes.rb:
>
> ActionController::Routing::Routes.draw do |map|
>   map.resources :coches
>   map.connect '':controller/:action/:id''
>   map.connect '':controller/:action/:id.:format''
> end

Is :id a magic thing that enforces an [:xdigit:] character class? Should - or
shouldn''t - that :id be like :filename?

--
   Phlip