How dows RoR work?

This is so frustrating. Is RoR that easy to learn or is it hype or is it
just me? I wonder how many newbies like me are surfing the docs trying
to get a clue of the basics. Every tutorial I find is much the same, and
seems to skip the fundmental parts. How should you understand the Ruby
API http://api.rubyonrails.org/?

What is < ActionController::Base? Can’t I set a cookie under that? Or do
I have to use that under ActionController::Cookies? I don’t get it.

Why do u need to set a cookie?

Pål Bergström wrote:

This is so frustrating. Is RoR that easy to learn or is it hype or is it
just me? I wonder how many newbies like me are surfing the docs trying
to get a clue of the basics. Every tutorial I find is much the same, and
seems to skip the fundmental parts. How should you understand the Ruby
API http://api.rubyonrails.org/?

What is < ActionController::Base? Can’t I set a cookie under that? Or do
I have to use that under ActionController::Cookies? I don’t get it.

Pål Bergström wrote:

This is so frustrating. Is RoR that easy to learn or is it hype or is it
just me? I wonder how many newbies like me are surfing the docs trying
to get a clue of the basics. Every tutorial I find is much the same, and
seems to skip the fundmental parts. How should you understand the Ruby
API http://api.rubyonrails.org/?

What is < ActionController::Base? Can’t I set a cookie under that? Or do
I have to use that under ActionController::Cookies? I don’t get it.

Read Agile Web D. with Rails - it’s a must in my opinion.
Contains a lot of stuff that’s not in the docs.

Joe

Read Agile Web D. with Rails - it’s a must in my opinion.

This is the correct answer, but make sure to get the second edition.

As for cookies:

cookies[:foo] = ‘bar’

The next day:

my_cookie = cookies[:foo]

my_cookie’s value is now ‘bar’

Guest wrote:

Why do u need to set a cookie?

Pål Bergström wrote:

This is so frustrating. Is RoR that easy to learn or is it hype or is it
just me? I wonder how many newbies like me are surfing the docs trying
to get a clue of the basics. Every tutorial I find is much the same, and
seems to skip the fundmental parts. How should you understand the Ruby
API http://api.rubyonrails.org/?

What is < ActionController::Base? Can’t I set a cookie under that? Or do
I have to use that under ActionController::Cookies? I don’t get it.

Just an example.

Alex W. wrote:

Read Agile Web D. with Rails - it’s a must in my opinion.

This is the correct answer, but make sure to get the second edition.

As for cookies:

cookies[:foo] = ‘bar’

The next day:

my_cookie = cookies[:foo]

my_cookie’s value is now ‘bar’

Thanks Alex. But this wasn’t my initial concern. More how I should read
the API. Can I use the cookie object under < ActionController::Base?

Joe wrote:

Pål Bergström wrote:

This is so frustrating. Is RoR that easy to learn or is it hype or is it
just me? I wonder how many newbies like me are surfing the docs trying
to get a clue of the basics. Every tutorial I find is much the same, and
seems to skip the fundmental parts. How should you understand the Ruby
API http://api.rubyonrails.org/?

What is < ActionController::Base? Can’t I set a cookie under that? Or do
I have to use that under ActionController::Cookies? I don’t get it.

Read Agile Web D. with Rails - it’s a must in my opinion.
Contains a lot of stuff that’s not in the docs.

Joe

I already got it. I’ll give it more time :slight_smile:

Thanks Alex. But this wasn’t my initial concern. More how I should read
the API. Can I use the cookie object under < ActionController::Base?

Don’t start with the API. You have be a little familiar with Rails
before the API make much sense. Once you have the basics of the MVC
setup of rails and can make a sample then start exploring the API.

That said, here’s a very basic intro.

Click around in the “Classes” frame and you will see a blurb at the top
of the documentation for each class describing how its method are used.
Below that is the actual methods in that class and what they do. There
is quite a bit of depth in some of the class hierarchies, but for the
most classes that start with ActionController have methods accessible in
your controller, ActiveRecord methods for the model, and ActionView is
methods for the view.

The top pane, is kinda useless for the most part. The bottom pane is an
alphabetical listing of every method, from every class, in the entire
framework. Use it if you are looking up how particular method works,
and you already know its name.

“Pål” == Pål Bergström [email protected] writes:

Is RoR that easy to learn or is it hype or is it just me?

Well, it took me all of one day to learn enough to start doing my own
things in it. Still doesn’t know it all, though.

How should you understand the Ruby API http://api.rubyonrails.org/?

Well…

What is < ActionController::Base?

…you do need at least a basic understanding of Ruby first. And
that question shows that you don’t have that. So, for the moment, stop
focusing on Rails and read a couple of Ruby tutorials.

An alternative is to buy the AWDwR book and read it.

	     Calle D. <[email protected]>
	 http://www.livejournal.com/users/cdybedahl/

“All printers are unreliable contraptions from the depths of hell sent
to
torture sysadmins.” – Russ Allbery

I found that the learning curve is steep, particular if you want to
start coding non trivial realworld apps.

To get RoR to do something useful and “professional” looking , you need
to understand ruby basics plus a quite a detailed understanding of CSS,
HTML and the ROR API. For me it is very hard to “think solutions”

The joy of course is that you can code non-trival realworld apps,
whereas in Java or even PHP everything soon decays into a “big ball of
mud”.

For me moving to the eclipse programing environment, with the ROR addons
helped a lot as when you are programing you seem to need to change a
many files just a little it also helps highlight the syntax bloopers
newbies make.

I believe that it is exteremly important that you first learn how MVC
(model-view-controller) is supposed to work.

ActionController::Base is the base class for action controller, the
controller part of the Rails framework. Your controllers need to
extend this class because it provides session, request, response, and
other get/post CGI stuff.

I think prerequisites for Rails are the following:

  1. Basic knowledge about relational databases (and ability to do some
    SQL if needed)
  2. Basic HTML and Javascript skills (Less JS than HTML – stay away
    from AJAX for awhile)
  3. Experience programming in ASP, PHP, Java (with JSPs), or Perl… so
    you have an understanding of how web-to-database applications work.

If you’re missing one of these skills, it’s not a show stopper… it
just means you’ll need to work harder. The Agile book is great. Do the
depot app and then read teh chapters that follow. They will give you
an inisight into what you were building. This helped me a lot.

Ruby on Rails really shines when you can appreciate what it is capable
of doing for you.

… and also post questions to this list. Ruby is sweet, but it is
still maturing and it is different enough from anything else out there
that there is a learning curve.

Part of the problem you are seeing is that much of the RoR information
presumes that you are already an accomplished HTML+javascript+taglib
programmer. I am spending more time learning these three than either
Ruby or Rails, and I started into this curve with a high level of
general programming knowledge.

Last night, I ended up ripping out the RoR generated tags from my learning project and replacing them with plain old HTML with embedded ruby instructions, just so I could understand and control what I was seeing. Taglibs may be great for experienced HTML programmers, but to a relative novice they just make the code unreadable.

We would have this part of the learning curve regardless of what back-
end programming language/framework we used (jsp, vbs, php, etc), so it
is not appropriate to point the finger at RoR as being hard to learn.

This is so frustrating. Is RoR that easy to learn or is it hype or is it
just me?

I think all the other points made to you are very good. However, I
wanted to
add that I didn’t begin to really understand how RoR worked until I had
it
in vendor/rails. Once it’s in there, I could set breakpoints and begin
to
understand the how part.

Good luck,
-DT (using RoR for 2 weeks now)

I believe that it is exteremly important that you first learn how MVC
(model-view-controller) is supposed to work.
I second that.

Everything else is no different from any other web programming language
you learn. Rails is just as much an approach to website development as
it is anything else.

With the HTML/JS/SQL argument when talking about Rails, i think these
skills are prerequisites of any web programming language. If you
don’t know these things i think you would struggle to make a
‘professional’ app in PHP or ASP or whatever - not just Rails.

The Agile book is a must - read from cover to cover and try out all the
examples. Then do it again. I just keep reading it over and i normally
find new stuff each time :0)

Steve

Brian H. wrote:

I believe that it is exteremly important that you first learn how MVC
(model-view-controller) is supposed to work.

ActionController::Base is the base class for action controller, the
controller part of the Rails framework. Your controllers need to
extend this class because it provides session, request, response, and
other get/post CGI stuff.

I think prerequisites for Rails are the following:

  1. Basic knowledge about relational databases (and ability to do some
    SQL if needed)
  2. Basic HTML and Javascript skills (Less JS than HTML – stay away
    from AJAX for awhile)
  3. Experience programming in ASP, PHP, Java (with JSPs), or Perl… so
    you have an understanding of how web-to-database applications work.

If you’re missing one of these skills, it’s not a show stopper… it
just means you’ll need to work harder. The Agile book is great. Do the
depot app and then read teh chapters that follow. They will give you
an inisight into what you were building. This helped me a lot.

Ruby on Rails really shines when you can appreciate what it is capable
of doing for you.

Glenn C. wrote:

I found that the learning curve is steep, particular if you want to
start coding non trivial realworld apps.

That’s what I found to. Not very hard to understand the basics and the
mvc-model, but not enough for more serious stuff.

If someone could just explain the MmmController <
ActionController::Basic or ActionController::Cookies etc, it would be
great. I search but I can’t find that explained. Then it would really
click.

Could also be that I’m not that familiare with classes. I can do rather
complex stuff in php, but classes isn’t my strong side. Perhaps this is
the problem.

To get RoR to do something useful and “professional” looking , you need
to understand ruby basics plus a quite a detailed understanding of CSS,
HTML and the ROR API. For me it is very hard to “think solutions”

With the little I’ve read so far I found Ruby quite easy, compared to
PHP. And what you say makes sense. I got the other part, trying to be in
the forefront of standards, but I need to think in solutions.

The joy of course is that you can code non-trival realworld apps,
whereas in Java or even PHP everything soon decays into a “big ball of
mud”.

True. :slight_smile:

For me moving to the eclipse programing environment, with the ROR addons
helped a lot as when you are programing you seem to need to change a
many files just a little it also helps highlight the syntax bloopers
newbies make.

I also use eclipse more and more. I was glad to find RadRails.

Thanks for your input.

Brian H. wrote:

I believe that it is exteremly important that you first learn how MVC
(model-view-controller) is supposed to work.

ActionController::Base is the base class for action controller, the
controller part of the Rails framework. Your controllers need to
extend this class because it provides session, request, response, and
other get/post CGI stuff.

Ok. I’ll have to think on that for a while.

I think prerequisites for Rails are the following:

  1. Basic knowledge about relational databases (and ability to do some
    SQL if needed)

Got that.

  1. Basic HTML and Javascript skills (Less JS than HTML – stay away
    from AJAX for awhile)

That to. Not so much AJAX, but I’m not so sure on security there.

  1. Experience programming in ASP, PHP, Java (with JSPs), or Perl… so
    you have an understanding of how web-to-database applications work.

Yes. Started in Lasso, which is more in class with Ruby in easiness.
Then PHP.

If you’re missing one of these skills, it’s not a show stopper… it
just means you’ll need to work harder. The Agile book is great. Do the
depot app and then read teh chapters that follow. They will give you
an inisight into what you were building. This helped me a lot.

Ruby on Rails really shines when you can appreciate what it is capable
of doing for you.

Sounds good :slight_smile:

On 6/7/06, Pål Bergström [email protected] wrote:

If someone could just explain the MmmController <
ActionController::Basic or ActionController::Cookies etc, it would be
great. I search but I can’t find that explained. Then it would really
click.

Could also be that I’m not that familiare with classes. I can do rather
complex stuff in php, but classes isn’t my strong side. Perhaps this is
the problem.

That’s your problem. As others have mentioned, it helps to take a
crash course in Ruby (there was a very good announcemtn of an online
pdf first chapter of a book I plan on getting when it’s released, but
my Mt Dew deprived brain cannot pull it forward at the time).

The Class < SuperClass construct is basically just saying that your
controller is a subclass of one of the other types of controllers. If
you want to be able to use the stuff in ActionController::Basic,
inherit from that; if you need stuff from ActionController::Cookies,
inherit from that. You can then call any of the applicable functions
from the superclass straight from the subclass (your controller).

If you’re not familar with OOP, learn about it and it will make sense.
The Object functionality of PHP is not a great model for true OOP
languages…

-Curtis