Rails internals?

Hi. I’m new to ROR, I bought the book “Agile Web D. with Rails,
Third Edition” and followed the depot example. I still can’t imagine me
developing a rails application after that. There are many things that
are not explained, and many things that are mentioned, e.g. Rails
methods, helpers, …, which I don’t know where to find them if I was
looking for them. Where can I find something like “Rails Internals”, as
I assume that not everything that Rails can do was mentioned in that
book. I’m looking for something that covers everything that rails
offers, where I can look for things that can help developing Rails
applications. I would like to develope a web application to manage
different language courses, participants, trainers, invoicing … This
should then be used by one or more separate language companies.

I hope my query is clear. Thanks for any answer.
Dani.

Dani D. wrote:

Hi. I’m new to ROR, I bought the book “Agile Web D. with Rails,
Third Edition” and followed the depot example. I still can’t imagine me
developing a rails application after that. There are many things that
are not explained, and many things that are mentioned, e.g. Rails
methods, helpers, …, which I don’t know where to find them if I was
looking for them. Where can I find something like “Rails Internals”, as
I assume that not everything that Rails can do was mentioned in that
book. I’m looking for something that covers everything that rails
offers, where I can look for things that can help developing Rails
applications. I would like to develope a web application to manage
different language courses, participants, trainers, invoicing … This
should then be used by one or more separate language companies.

I hope my query is clear. Thanks for any answer.
Dani.

Hi Dani,
Take a look at rails guide ‘http://guides.rubyonrails.org/’. This would
help you to get started in rails.

Dani D. wrote:

Hi. I’m new to ROR, I bought the book “Agile Web D. with Rails,
Third Edition” and followed the depot example. I still can’t imagine me
developing a rails application after that.

Have you tried? Sometimes you just have to take the plunge in order to
learn something.

There are many things that
are not explained, and many things that are mentioned, e.g. Rails
methods, helpers, …, which I don’t know where to find them if I was
looking for them.

If you ask questions, perhaps we can help.

Where can I find something like “Rails Internals”, as
I assume that not everything that Rails can do was mentioned in that
book. I’m looking for something that covers everything that rails
offers, where I can look for things that can help developing Rails
applications.

Then you’re probably not looking for Rails internals at this stage.
Just look through the Rails guides and the API docs
(http://www.railsapi.com presents the docs more readably than the
official site).

I would like to develope a web application to manage
different language courses, participants, trainers, invoicing … This
should then be used by one or more separate language companies.

Do it, then! Start with what you can figure out, and do research and
ask questions as necessary. Do all development test-first.

I hope my query is clear. Thanks for any answer.
Dani.

Best,

Marnen Laibow-Koser
http://www.marnen.org
[email protected]

Thanky you both Marnen & Anubhaw.

I did run the depot example application and even used debugger to see
things from “inside”, but still felt like someone who types in what he
was told. The feeling is still there, if I had to do it myself, there
are things I wouldN’t know even they exist if they were not mentioned in
the book. That is what I ment when I ask - where is the collection of
all the methodes, helpers, … of rails. I’ll go to those sites you both
have mentioned. I’m sure I’ll come with further questions.
I do apprciate your quick answer and your motivation to help. Thank you
!.
Dani.

Ar Chron wrote:

Dani D. wrote:

Thanky you both Marnen & Anubhaw.

I did run the depot example application and even used debugger to see
things from “inside”, but still felt like someone who types in what he
was told. The feeling is still there, if I had to do it myself, there
are things I wouldN’t know even they exist if they were not mentioned in
the book. That is what I ment when I ask - where is the collection of
all the methodes, helpers, … of rails. I’ll go to those sites you both
have mentioned. I’m sure I’ll come with further questions.
I do apprciate your quick answer and your motivation to help. Thank you
!.
Dani.

So start your own project. On something you already know, so your not
focused on “what data do I need”, or “who are the users”, or “how is the
data organized” - you know, all those domain knowledge questions that
are usually the most important things, and can instead focus on “how do
I do this in Rails”.

One of the most useful things I did early on was to scaffold a
rudimentary application for a person’s information, then read through
and look at all the scaffolded routines, etc to see how rails wants to
work.

Hey, good advice (well, except that I usually counsel beginners away
from scaffolding)! My first Rails project (after a false start) was a
complete rewrite of an app I’d already created in PHP. I deliberately
didn’t copy the backend structure – I wanted to make sure I used Rails
as Rails – but I did basically copy the UI exactly. It was a great
learning experience, because I already knew how the app was supposed to
work and could focus on the framework.

Best,

Marnen Laibow-Koser
http://www.marnen.org
[email protected]

Dani D. wrote:

Thanky you both Marnen & Anubhaw.

I did run the depot example application and even used debugger to see
things from “inside”, but still felt like someone who types in what he
was told. The feeling is still there, if I had to do it myself, there
are things I wouldN’t know even they exist if they were not mentioned in
the book. That is what I ment when I ask - where is the collection of
all the methodes, helpers, … of rails. I’ll go to those sites you both
have mentioned. I’m sure I’ll come with further questions.
I do apprciate your quick answer and your motivation to help. Thank you
!.
Dani.

So start your own project. On something you already know, so your not
focused on “what data do I need”, or “who are the users”, or “how is the
data organized” - you know, all those domain knowledge questions that
are usually the most important things, and can instead focus on “how do
I do this in Rails”.

One of the most useful things I did early on was to scaffold a
rudimentary application for a person’s information, then read through
and look at all the scaffolded routines, etc to see how rails wants to
work.

rails myapp -d mysql
ruby script/generate scaffold person first_name:string last_name:string
age:integer

Then go peruse the generated files and ‘grok’ how the Rails framework
works.

Many books dive in with an application that fits how that author builds
rails apps. Sure, one would suppose that an author is an authority on a
subject, but read 5 Rails books and you’ll get 5 different perspectives
on how to build an app, how to define your views, etc, etc.

I wouldn’t use a scaffolded application for a releasable product, but as
an instructional tool, it’s virtually free.

On 23 April 2010 12:43, Dani D. [email protected] wrote:

Hi. I’m new to ROR, I bought the book “Agile Web D. with Rails,
Third Edition” and followed the depot example. I still can’t imagine me
developing a rails application after that. There are many things that
are not explained, and many things that are mentioned, e.g. Rails
methods, helpers, …, which I don’t know where to find them if I was
looking for them.

One idea is to hang about here, any question that you understand (at
least vaguely), then attempt to understand the answers. This will
rapidly lead you to a greater depth of knowledge. In no time you will
find yourself answering questions (provided you do not mind
occasionally making a fool of yourself of course).

Colin

Dani D. wrote:

Thank you all.

Why not use scaffold in production ?

It’s underpowered and inflexible. By the time you get to having a
production-ready app, you will probably have customized or completely
removed your scaffold.

I tend not to use scaffolding even when I’m trying to quickly set up a
new app. I wouldn’t mourn it if it were removed from Rails.

If you want something scaffold-like with more utility, check out
ActiveScaffold. It’s probably not what you want for end-user-facing
stuff, but it’s nice for things like admin interfaces.

Dani

Best,

Marnen Laibow-Koser
http://www.marnen.org
[email protected]

On 23 April 2010 22:54, Dani D. [email protected] wrote:

Thank you all.

Why not use scaffold in production ?

I know some are not keen on scaffolding, but personally I found it
useful when getting started as it allows one to get to something that
provides basic functionality without needing to understand fully what
is going on. There are down sides however as it can lead one to be
over dependent on it and never understand fully what is going on.
For example many beginners assume that there must always be a
one-to-one correspondence between controllers and models, which is
definitely not the case.

Colin

Thank you all.

Why not use scaffold in production ?
Dani

Hello there. When I was starting with Rails last month, I have tried a
lot of books and not finishing everyone of them. It was that the books
I found was outdated, they’re too technical for me to grasp or they
just threw lines in which I have to type without explaining what they
did sans Rails’ magic. The book that worked for me was Simply Rails
2.0 by Patrick Lenz since it is a practical guide and everything is
explained.

On 24 April 2010 14:34, Marnen Laibow-Koser [email protected]
wrote:

But what’s going on is easy enough to understand and fundamental.

I am not sure that it is necessarily easy to understand for the
absolute beginner. I think maybe what I meant was that having the
code automatically produced and in front of one can help in the
initial understanding of how to do basic things such as create and
update such that they become easy in retrospect.

I don’t think there is an absolute answer as to whether scaffolding is
a ‘good thing’ or not. I believe that, for me, it was helpful, but
for others maybe not.

Colin

Colin L. wrote:

On 23 April 2010 22:54, Dani D. [email protected] wrote:

Thank you all.

Why not use scaffold in production ?

I know some are not keen on scaffolding, but personally I found it
useful when getting started as it allows one to get to something that
provides basic functionality without needing to understand fully what
is going on.

But what’s going on is easy enough to understand and fundamental.

There are down sides however as it can lead one to be
over dependent on it and never understand fully what is going on.
For example many beginners assume that there must always be a
one-to-one correspondence between controllers and models, which is
definitely not the case.

Exactly!

Colin

Best,

Marnen Laibow-Koser
http://www.marnen.org
[email protected]

Colin L. wrote:

On 24 April 2010 14:34, Marnen Laibow-Koser [email protected]
wrote:

But what’s going on is easy enough to understand and fundamental.

I am not sure that it is necessarily easy to understand for the
absolute beginner.

Perhaps not, but it’s necessary to understand it in order to do anything
else with Rails.

I think maybe what I meant was that having the
code automatically produced and in front of one can help in the
initial understanding of how to do basic things such as create and
update such that they become easy in retrospect.

That I might agree with (although I tend to use make_resourceful for
CRUD).

I don’t think there is an absolute answer as to whether scaffolding is
a ‘good thing’ or not. I believe that, for me, it was helpful, but
for others maybe not.

You’re right, there’s no absolute answer. I’ve seen too many people
treating generated scaffolding as sacred and unmodifiable, which is
perhaps partly responsible for my attitude. Also, I cut my teeth on
Rails 1.x, back in the days of the scaffold method, which really was a
useless, overhyped newbie hook. The scaffold generator is admittedly
much better.

Colin

Best,

Marnen Laibow-Koser
http://www.marnen.org
[email protected]

Thank you to all for your entries and time.
Dani

Hi,

I’ve still got things to learn about RoR - always will have I guess,
which is part of the enjoyment - and I would recommend having the
Pickaxe book (Programming Ruby) as close to hand as possible. AWDwR
was a good place to start for me, but as Rails is Ruby Code, I find
the Pickaxe more useful now - however, from what I have seen from the
guys at PragProg, the next edition of AWDwR may be more of what you
need. Edition 4 is in BETA now, and this comes from the PragProg site:

“You’ll still find the Depot example at the front, but you’ll also
find testing knitted right in. Gone are the long reference chapters—
that’s what the web does best. Instead you’ll find more targeted
information on all the aspects of Rails that you’ll need to be a
successful Web developer”

Checkout
http://pragprog.com/titles/rails4/agile-web-development-with-rails-4th-edition
for more info.

I would definitely recommend just jumping in and starting a simple
App, as previously suggested - something like an address book - and
work through that. You’ll make mistakes, and then you’ll learn from
them. Also, try freezing rails:

rake rails:freeze:gems # page 259 of AWDwR Edition 3

This will place a copy of your current version of rails into the
vendors folder, you can then easily dig into the actual Rails code,
play with it, change it, break it, fix it, learn from it, without
worrying.

If you don’t understand Ruby, I think you’ll struggle a bit to do
anything other than generate basic scaffolded apps so I think the
Pickaxe is a must. How can you understand what Rails is doing/can do,
if you don’t have an understanding of Ruby?

Finally, one to think about for the future is Metaprogramming Ruby,
again from PragProg, but I would leave this until you are up to speed
with Ruby in general - depending on your background of course. It gave
me a lot of good insights into Ruby as well as Rails.

Good luck with it,

Paul