Forum: Ruby on Rails RoR for dummies .. from nothing to knowlege

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.
0fc8cdefe9375828e65e650b73887ac1?d=identicon&s=25 Simone R. (athlon)
on 2009-03-03 11:14
Well,
i'm like a dinosaur .. an ASP classic procedural developer but I think
it's' time to evolve, so I started learning RoR and OO/MVC programming.

As a First step I did the two "try" on the netbeans website and
everythig was fine so i'm making a to do list of simple project for
getting better and better
knowlege about Ror.


righrt now i thinked this "demo" project:

1:
a CRUD for making mail footer (you can insert your name , phone ,and
skype)
and the app will make a nice .zip with inside a personalized html to use
as mail footer. (right now I have this app made with asp+mdb

2:
a login system ... a user can register himself with mail validation and
later logon and change his password


3:
a filemanager .. you can upload , download and delete a file


next ... ?

add your comment

thanks
1ea6432b1ebff1aa0197074672428e59?d=identicon&s=25 Vincent Bakker (vinbak)
on 2009-03-03 11:35
You can find all the needed code snippets in Advanced Rails Recipes. I
would recommend using this book for pointers and code snippets.

http://railsbookclub.com/advanced-rails-recipes

(zipping up and generating files, login system through
acts_as_authenticated, manipulating files)


Simone R. wrote:
> Well,
> i'm like a dinosaur .. an ASP classic procedural developer but I think
> it's' time to evolve, so I started learning RoR and OO/MVC programming.
>
> As a First step I did the two "try" on the netbeans website and
> everythig was fine so i'm making a to do list of simple project for
> getting better and better
> knowlege about Ror.
>
>
> righrt now i thinked this "demo" project:
>
> 1:
> a CRUD for making mail footer (you can insert your name , phone ,and
> skype)
> and the app will make a nice .zip with inside a personalized html to use
> as mail footer. (right now I have this app made with asp+mdb
>
> 2:
> a login system ... a user can register himself with mail validation and
> later logon and change his password
>
>
> 3:
> a filemanager .. you can upload , download and delete a file
>
>
> next ... ?
>
> add your comment
>
> thanks
0fc8cdefe9375828e65e650b73887ac1?d=identicon&s=25 Simone R. (athlon)
on 2009-03-03 12:03
Vincent Bakker wrote:
> You can find all the needed code snippets in Advanced Rails Recipes. I
> would recommend using this book for pointers and code snippets.
>
> http://railsbookclub.com/advanced-rails-recipes
>
> (zipping up and generating files, login system through
> acts_as_authenticated, manipulating files)
>


well, more than find the actual code I need some hint if this demo apps
can
be useful for learning the "building blocks" , for sure I will buy the
book for reference but in the ASP world with this 3 app you can build a
good starting knowlege , maybe in RoR is differen there are other
problem on wich you need to build skill before going on real programming
170e2a48994775e4c298c302e6814f81?d=identicon&s=25 Starr Horne (Guest)
on 2009-03-03 19:48
(Received via mailing list)
> well, more than find the actual code I need some hint if this demo apps
> can
> be useful for learning the "building blocks" , for sure I will buy the
> book for reference but in the ASP world with this 3 app you can build a
> good starting knowlege , maybe in RoR is differen there are other
> problem on wich you need to build skill before going on real programming

You might take a look at the RailsSpace book. It goes through the
creation
of a social network site using rails and assumes zero knowledge.

http://www.amazon.com/RailsSpace-Building-Networki...

--
Starr Horne
My blog: http://starrhorne.com
Check out my Helpdesk RailsKit: http://railskits.com/helpdesk/
1ea6432b1ebff1aa0197074672428e59?d=identicon&s=25 Vincent Bakker (vinbak)
on 2009-03-04 08:44
Simone R. wrote:
> Vincent Bakker wrote:
>> You can find all the needed code snippets in Advanced Rails Recipes. I
>> would recommend using this book for pointers and code snippets.
>>
>> http://railsbookclub.com/advanced-rails-recipes
>>
>> (zipping up and generating files, login system through
>> acts_as_authenticated, manipulating files)
>>
>
>
> well, more than find the actual code I need some hint if this demo apps
> can
> be useful for learning the "building blocks" , for sure I will buy the
> book for reference but in the ASP world with this 3 app you can build a
> good starting knowlege , maybe in RoR is differen there are other
> problem on wich you need to build skill before going on real programming

RailsSpace, Beginning Rails or Simply Rails 2 are great learning books.
These books take you through the process of developing an entire app
from a to z. (social network, e-commerce site of news site)

I find these methods really handy. Not only do you get a cleared picture
of the coherence of the code, you also learn a bit about plugins,
generators, test driven development, ajax etc.

I would start with: Beginning Rails (http://tinyurl.com/b438x8). A file
manager and a mail footer creator are not the best starting points,
since an important part of Ruby on Rails is developing database driven
webapps and working through the MVC principle.
80e4cb97cae5c8d745f72337d93fd8f2?d=identicon&s=25 MaD (Guest)
on 2009-03-04 09:28
(Received via mailing list)
i think your project is a pretty good start. if you are going to code
it all by yourself, maybe even put your authentication-code into a
plugin and in the end try to exchange it with sth. like
restful_athentication, then you got your hands dirty enough to start a
serious project. depending on your personal goals you could take a few
steps into the way rails handles AJAX (prototype, ...).

in general your goals should be to:
- be able to write some basic ruby-code
- get an understanding for the way rails works and models, views and
controllers interact with each other
- work with plugins (use them and maybe write your own) and gems
- write valid html and css
- use some AJAX
- secure your application

as i see it your demo-project allows you to dive into all these
topics. everything else depends on your personal needs and plans.
80e4cb97cae5c8d745f72337d93fd8f2?d=identicon&s=25 MaD (Guest)
on 2009-03-04 09:34
(Received via mailing list)
oh, yeah i forgot:
 - be sure to test your app. either you use the built in test-
framework or something like rspec.

btw: it really doesn't matter which book your reading or which
tutorial you are following. your approach of getting your hands dirty
and trying to build a (not so trivial) app on your own is IMHO a very
good one. you will need to combine the examples of different tutorials/
books into one working app. that will teach you a lot about rails.
4e515deb518e9195f0dc45ec2af6a541?d=identicon&s=25 Karel Minařík (karmi)
on 2009-03-04 10:28
(Received via mailing list)
Simone,

lots of people don't know about Rails Guides project:
http://guides.rails.info
. It has wonderful up-to-date content on lots of topics.

You may want to start with "Getting Started with Rails":
http://guides.rails.info/getting_started.html

--karmi

On Mar 3, 11:14 am, "Simone R." <rails-mailing-l...@andreas-s.net>
0fc8cdefe9375828e65e650b73887ac1?d=identicon&s=25 Simone R. (athlon)
on 2009-03-04 18:39
Well,

first many thanks to all of you for all you hints,  they are very
usefull.



for now I did a few times both this tutorial
http://www.netbeans.org/kb/docs/ruby/rapid-ruby-weblog.html
http://www.netbeans.org/kb/docs/ruby/model.html

and i feel a little less dinosaur :-)

after this tutorial I created another application with two model (cars
and animals) an I made links from one model to the other in different
point
(just for fun and for unterstanding rest) ...

now I'm trying to make an """homepage"" with a list of all models
existing in my app.

Reading around looks like I need an "observer" .. but I'm not sure (as
usual)


How can i get a page that dinamically generate something like
ul
li \cars
li \animals
ul
0fc8cdefe9375828e65e650b73887ac1?d=identicon&s=25 Simone R. (athlon)
on 2009-03-04 23:33
>
> How can i get a page that dinamically generate something like
> ul
> li \cars
> li \animals
> ul

i forgot .. my apps is made out of

generate scaffold    car         name:string power:string
generate scaffold animal             name:string speed:string
80e4cb97cae5c8d745f72337d93fd8f2?d=identicon&s=25 MaD (Guest)
on 2009-03-05 09:10
(Received via mailing list)
# controller:
def show_all_models
  # require all of your models so they get loaded
  Dir.glob(RAILS_ROOT + '/app/models/*.rb').each { |file| require
file }
  # find all subclasses of ActiveRecord
  @all_models = Object.subclasses_of(ActiveRecord::Base)
end

# view:
<ul>
  <% @all_models.each do |model| %>
    <li><%= model %></li>
  <% end %>
</ul>

if you are using ActiveRecordStore there is probably a model in there
for that as well. if you don't want to display that one, remove it
inside your controller.
0fc8cdefe9375828e65e650b73887ac1?d=identicon&s=25 Simone R. (athlon)
on 2009-03-06 11:43
MaD wrote:
> # controller:
> def show_all_models
>   # require all of your models so they get loaded
>   Dir.glob(RAILS_ROOT + '/app/models/*.rb').each { |file| require
> file }
>   # find all subclasses of ActiveRecord
>   @all_models = Object.subclasses_of(ActiveRecord::Base)
> end
>
> # view:
> <ul>
>   <% @all_models.each do |model| %>
>     <li><%= model %></li>
>   <% end %>
> </ul>
>
> if you are using ActiveRecordStore there is probably a model in there
> for that as well. if you don't want to display that one, remove it
> inside your controller.

OK , it works .. but I have to put it inside the animals controller and
inside
the def index , how can I create an "homepage" ?



NEXT STEP


In my app there is a class CAR name:string power:string (has_many:
WHEELS)
 ... is possible to create a scaffold of MUSCLE_CAR that extend CAR and
inherit everything from CAR (name,power and WHEELS)

and later if I add something to CAR (like door_number) will also appear
into MUSCLE_CAR ?
This topic is locked and can not be replied to.