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
(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
(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
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.
(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.
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.
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.
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
@all_models = Object.subclasses_of(ActiveRecord::Base)
end
view:
<% @all_models.each do |model| %>
<%= model %>
<% end %>
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.
@all_models = Object.subclasses_of(ActiveRecord::Base)
end
view:
<% @all_models.each do |model| %>
<%= model %>
<% end %>
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 forum is not affiliated to the Ruby language, Ruby on Rails framework, nor any Ruby applications discussed here.