Month: November 2009

  • Simplifying the weight CRUD

    After a rather long fight with formtastic I have a better CRUD for weight: But now that I think about it, there shouldn’t be a measured at in this view. That should be in an advanced new-form.

  • Making the weight CRUD work per user

    In the previous two posts I created a full CRUD, using scaffolding, for weights and a way to get the current user. The weight CRUD, as it was, allowed you to edit data for any user (check out the screenshots). Moving from there to editing data only for yourself was trivial. In the views I […]

  • 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 […]

  • Creating the weight model and scaffolding

    With one command line I’ve created the weight model and the scaffolding, a fully functional CRUD little app without my Rails app. I know all Rails developer are rolling eyes now; but I still think this is awesome. It gets you up and running so fast: ./script/generate scaffold weight user_id:integer weight:float timestamp:datetime exists app/models/ exists […]

  • 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 […]

  • The tracker for movies

    For showing what music I like, keeping track of what music I listen to, discovering new music and finding people with the same tastes I use last.fm. For doing that but with books I use aNobii. Is there anything like that for movies? If not, there’s a market.