Forum: Ruby on Rails general questions

Announcement (2017-05-07): www.ruby-forum.com is now read-only since I unfortunately do not have the time to support and maintain the forum any more. Please see rubyonrails.org/community and ruby-lang.org/en/community for other Rails- und Ruby-related community platforms.
C1e5a9e9344b6d31b9df7303e6dc378a?d=identicon&s=25 Craig White (Guest)
on 2006-01-30 08:55
(Received via mailing list)
Agile book lacks some basic information, perhaps I need to learn ruby as
I am lacking information - some basic things - especially debugging.

The following are stupid newbie questions and any portion of them
answered would be great.

1. If I am viewing a page from app/views/clients/ and on this page, I
want to put a 'link_to' directive to say app/views/case_managers...
how do I do this? For example,
<% link_to client.case_manager_wholename, :action => case_managers/show
%>

takes me to /clients/case_managers/show.rhtml which is an error instead
of /case_managers/show.rhtml which is where I wanted to go,.

2. rdoc...  I tried the other day...I somewhat forgot but I think I
tried something like 'rdoc Application::Controller' and it reported
couldn't find the file and exited...where do I find information on how
to use ri and rdoc ?

3. type conversions and concatenation...where do I find information on
this?

4. Is the answer one of the Ruby books? Which one? Pragmatic Programming
with Ruby?

Thanks

Craig
F98e8bbc010d8ff9818c2f46319b86cc?d=identicon&s=25 Dominique Plante (dplante)
on 2006-01-30 09:28
Craig White wrote:
> Agile book lacks some basic information, perhaps I need to learn ruby as
> I am lacking information - some basic things - especially debugging.
>
> The following are stupid newbie questions and any portion of them
> answered would be great.
>
> 1. If I am viewing a page from app/views/clients/ and on this page, I
> want to put a 'link_to' directive to say app/views/case_managers...
> how do I do this? For example,
> <% link_to client.case_manager_wholename, :action => case_managers/show
> %>
>
> takes me to /clients/case_managers/show.rhtml which is an error instead
> of /case_managers/show.rhtml which is where I wanted to go,.

This might help you...
Page 350 of Agile Web Development with Rails says suggests you might
want to try <%= link_to client.case_manager_wholename,
 :controller=>case_managers
 :action=>show
%>

Please let me know if this worked for you or not.

Thanks,
Dominique
3dfb09682a075fb098dd01c4a8b1b3cf?d=identicon&s=25 pmt (Guest)
on 2006-01-30 10:15
> 3. type conversions and concatenation...where do I find information on
> this?

To convert, you an use @var.to_i (for Fixnum), .to_f (for Float), .to_s
(for string).. And to convert into a date, you can use :

    @date Time.parse(str=@str_date)

And to concatene, you can use +.

I use a book, a GREAT book, "Agile Web Development with Rails" and few
sites.. :
http://api.rubyonrails.com
http://railsmanual.org

and this one it's great for your search:
http://www.rubycentral.com/book/lib_standard.html

Good Rails

pmt
C1e5a9e9344b6d31b9df7303e6dc378a?d=identicon&s=25 Craig White (Guest)
on 2006-01-30 16:30
(Received via mailing list)
On Mon, 2006-01-30 at 09:28 +0100, Dominique Plante wrote:
> > <% link_to client.case_manager_wholename, :action => case_managers/show
> %>
----
thanks - it worked fine after I added
  :id => client.case_manager_id

that was exactly the issue...I needed the :controller directive.

Thanks

Craig
This topic is locked and can not be replied to.