Tag: Ruby

  • Getting the current user

    I’m not using any authentication gem or plug in, I’m rolling my own. I’m actually using OpenID, so rolling my own is not hard: no passwords to encrypt, resend and send, no email address to verify. I think this is the future. But I’m also doing something that I call ghost users. When you use […]

  • Profile models

    The profiles in Sano are built out of two models: User OpenId The reason to have an OpenId model and not just one field in the User model is that I like giving users the possibility of defining more than one OpenId provider. StackOverflow does that and since I use my own OpenId server, the […]

  • rails sano

    For those that never used Ruby on Rails, basically you run: rails <projectname> and you have a complete runnable Rails project with lot’s of placeholders so that you don’t have to worry about where to put stuff and making sure things work well together. Just after doing rails sano I went and run the testing […]

  • I'm going to do an experiment today

    I’ve started learning C# and ASP.NET MVC about 5 or 6 months ago. While learning I’ve developed a clone of Reddit that had a very clear differentiator: you could see the messages and the web page at the same time. When I was close to completion Reddit released exactly that feature. I scrapped that project. […]

  • Quick and dirty tabs on Ruby on Rails

    For my Ruby on Rails pet project Is it Science Fiction? I’ve reached that point when I wanted to show tabs. You know, for the menu, on top of the page. I quickly wrote something like: <ul class=”tabs”> <li><%= link_to ‘Home’, root_url %></li> <li><%= link_to ‘Recommend’, new_item_url %></li> <li><%= link_to ‘Ranking’, items_url %></li> <% if […]

  • Ensuring the displaying of flash messages in Ruby on Rails

    Ensuring the displaying of flash messages in Ruby on Rails

    Ruby on Rails has a special object called flash which hold its contents for one more request. It’s particularly useful to show messages after a redirect. Since it’s good style to redirect after each succesful form post, that’s where you put the messages such as: “You’ve logged in”, “Thank you for your feedback”, “The book […]

  • NetBeans could make the Ruby on Rails experience great

    NetBeans could make the Ruby on Rails experience great for the vast majority of developers who are using Windows, where installing Ruby, Rails, PHP, MySQL, Python, etc is always a pain and the end result is ugly. But it falls short in some important ways which turned my experience with it into a nightmare. The […]

  • Playing with Ruby

    This is a remake of Installing Rails 2 on Ubuntu but targeting Ruby in general and with some improvements. Essentially the same, actually, but more usable, at least for myself. Ubuntu, like many other free operating systems, have a beautiful package management system that will track what depends on what, what is installed, what is […]

  • Installing Rails 2 on Ubuntu

    Ubuntu, like many other free operating systems, have a beautiful package management system that will track what depends on what, what is installed, what is not, what is not longer needed, which versions of each. If you tamper with it, you are asking for trouble. If you do a manual upgrade, from sources, eventually a […]

  • Quick and dirty continuous testing with Ruby on Rails

    I like the idea of continuous testing: seeing that you broke it, the moment you broke it and the same for fixing. There are some tools to do it, but since they are not packaged, yet, for my operating system of choice I went through the quick and dirty route: watch -n 5 rake test […]