That's great that you're learning a new language. I really hope you have tons 
of fun and make a whole lot of neat stuff. Keep us posted, kay?

On forms: The :action property is optional - if you omit it, it'll submit the 
form to the same URL you're currently on in your web browser. You use R() in 
the action just like you'd use it on an a(:href => R(…)) link. The thing about 
PageX, is that it takes one thing with it, the X - so it's urls look like 
/page/something/, and you kind of need to tell it what the something is. If you 
make a controller called, say, class MyCoolStuff; then you can just :action 
towards R(MyCoolStuff) and that'll be that.

I hope that clears things up a bit.

—
Bluebie



On 30/08/2011, at 1:47 PM, Anonymous Waffles wrote:

> Hello guys, I'm new to the Ruby, and especially to Camping. I've been
> having some difficulty because there aren't that many tutorials about
> Camping compared to other larger frameworks.
> I've been building some small stuff recently to learn about how it
> work, but I've puzzles as to how user input in a textbox is processed.
> Here's some code from the awfully short yet extremely informative
> Camping Book:
> 
> module Nuts::Views
>  def edit
>   h1 @page.title
>   form :action => R(PageX, @page.title), :method => :post do
>     textarea @page.content, :name => :content,
>       :rows => 10, :cols => 50
> 
>     br
> 
>     input :type => :submit, :value => "Submit!"
>   end
>  end
>  end
> 
> It's apparent that since the input is encased in the textarea block,
> it send the value when clicked. the :action says what class to send it
> to, and :method which method. The docs say that the R() syntax is for
> creating a path. Could I simply use the name of a controller instead,
> if it's in the same Ruby file?
> 
> And how is it sent along? Must the post method have a certain argument?
> 
> If somebody could answer my questions it would be extremely appreciated.
> 
> -Waffles _______________________________________________
> Camping-list mailing list
> Camping-list@rubyforge.org
> http://rubyforge.org/mailman/listinfo/camping-list

_______________________________________________
Camping-list mailing list
Camping-list@rubyforge.org
http://rubyforge.org/mailman/listinfo/camping-list

Reply via email to