Riding the Rails Day 1

Riding the RailsSo, i have made the incredibly wise decision to start learning Ruby on Rails while im home for a week. Wise because my Agile Web Development with Ruby on Rails book is in my bookshelf in Aachen … don’t ask.

What can i say so far? Wow! There are a lot of hypes, and i am always careful about those kinda people which want to propagate an image of the ultimate solution, the cure to every problem there is. Let me start by saying: No, Ruby and the Rails framework are not perfect nor do they fit every problem. But when it comes to database-driven web development they are certainly one of the easiest things to use. I dont know what the future will bring, and although O’Reilly’s Ruby book sales already overtook the Python books, there is no saying what cool new things the future might bring.

Having said this, rails is something everyone should give a try. So far i only developed web applications (just small scripts, a guestbook, stuff like that) with Perl or PHP. In retrospect i still love Perl, but for the web applications it sucked imho. PHP was okay, but i dont think i have to eloborate on certain PHP shortcomings here. Rails has the great advantage on being built ontop of Ruby, a very clean, simple and easy object-oriented programming language. Now Ruby has been around some time, and is a full-blown complete language, you can use it outside any web environment without a problem.

Rails is a framework (get used to that term and make sure you know what it means ;) which does a lot of those tedious tasks for you. It creates a directory structure, provides its own webserver for development, handles connection to your database, simplifies stuff like AJAX or authentication.

Its my first day, and i probably just sratched the cool things, but im already very impressed. Stay tuned.

[tags]ruby, rails, ajax, web, development[/tags]

Fun Stuff with Ruby on Rails/JScript

Fun stuff you find out when trying to get into Ruby on Rails. Since the prototype and effects library come with Rails it is no surprise that one stumbles over then at some point (when doing some AJAX stuff for example). Now, i know that there are some cool things out there, but i have never even used Javascript or been very tempted to do so. Well, until now ;). Check out the links below, they do something with the header of the weblog (so, this is only cool as long as this article is on top or when you have opened the article page).

Toggle visibility (Use this when one of the effects has hidden the header)

The following only make sense when the header is visible ;)

Shake it baby!

Fade away!

Fold it!

Shrink it!

This make sense when the header is invisible

Blind Down!

Appear!

It seems that the Effects are courtesy of script.aculo.us, a website dedicated to those effects in RoR/AJAX Environments, which i have visited many times before, but never used their stuff. I can only guess how much cool things lie ahead ;)

Kleines Quiz

I ... cant ... stop

– Sieht ihr Zimmer so aus? – [ ]

– Fangen die Schweissflecken unter ihren Armen an souveräne Staaten zu bilden? – [ ]

– Stehen sie eine Kaffeetasse vor spontanen und unkontrollierten Zuckungen? – [ ]

– Nehmen ihre Gänge zum Klo exponentiell mit fortschreitender Zeit zu? [ ]

Auflösung:

Haben sie 4 oder mehr Kreuze gemacht: Glückwunsch! Sie sind der Typ der kurz vor einer LA-Klausur steht und wünscht er hätte noch 2 Wochen Monate mehr Zeit zum Üben. Allerdings sollten sie als Schütze in den nächsten 4 Tagen Stunden auf ihre geistige Unversehrtheit achten.

Prolog (oder: ist doch logisch)

Jaja, ich mach gleich weiter, dachte nur mal kurz ich könnte die Freude weiterverteilen.

{trace}
| ?- f(D,g(A,B)) = f(g(B,C),g(u(v(t),B),h(v(C)))).
1 1 Call: f(_16,g(_17,_18))=f(g(_18,_25),g(u(v(t),_18),
         h(v(_25)))) ? 
1 1 Exit: f(g(h(v(_25)),_25),g(u(v(t),h(v(_25))),h(v(_25))))=
         f(g(h(v(_25)),_25),g(u(v(t),h(v(_25))),h(v(_25)))) ? 

A = u(v(t),h(v(C)))
B = h(v(C))
D = g(h(v(C)),C)

yes

Alles klar? Prima!

subscribe via RSS