page object

Matt Smart
Sun, 31 May 2009 00:41:21 -0000

Hello,

I''m new to the group, and still learning rails. I am a C++ programmer
by trade, so I''m finding some of the rails semantics confusing. When I
come accross a statement like this:

<%= link_to_function "clickme" do |page| ...

... and then a few lines that I do understand, could someone explain
to me the following: the link_to_function function takes some object
for the rendered link, and then what? it''s supposed to be *args, and
then &block. I assume that the code that comes afterward is the
reference to a block of text, but how does the args part work? Also,
in this instance, how does the do evaluate |page|? and last: where in
the rails API docs is the reference for the page object?

I''m sure someone well versed in ruby can explain this to me. Thankyou
for any help. Even links to documentation that explains these ruby
operators would help. Thanks again,

Matt