Tag Archives: Ruby on Rails

Hashes for select

In Ruby on Rails there’s a very easy way to create a select tag: form.select("period", [["Month", 1], ["Year", 12]]) In my case I have the options in a hash, like: periods = { 1 => "Month", 12 => "Year" } … Continue reading

Posted in tutorial | Tagged , , , , , , | Leave a comment

Show a devise log in form in another page

Devise create various forms, among them one for signing up and one for logging in of course. These are the forms as they are generated in Devise 1.0.8: <h2>Sign up</h2>   <% form_for resource_name, resource, :url => registration_path(resource_name) do |f| … Continue reading

Posted in tutorial | Tagged , , | Leave a comment

My first contribution to Rails

Looking forward to many others.

Posted in announcement | Tagged , | Leave a comment

Really resetting the database

When I start coding a Ruby on Rails project, I find myself modifying the migration files over and over. I know this is not the way they were intended to use, but to avoid upfront design, I only ad fields … Continue reading

Posted in tutorial | Tagged , , , , , | 4 Comments

My Profile page: a RESTful single resource using Formtastic

I’ve just implemented the My Profile tab for Sano: Can I write 500 words about? Well, I can try. I like using RESTful routes. In case you don’t know what they are let me try to explain it quick, at … Continue reading

Posted in other | Tagged , , , , , | Leave a comment

Migrations that change the schema

Up until today I did everything with a lot of planning and I let my OCD use migrations in a way they were not intended: I would go back and fix old migrations and destroy the database and re-run them. … Continue reading

Posted in other | Tagged , , , , | Leave a comment

I love to code

I said I was done for the day more than 6 hours ago, but I love to code, I couldn’t stop. I wanted to implement a small feature: make the creation of new weights simpler for the common case and … Continue reading

Posted in other | Tagged , , , , , | Leave a comment

Sano is open for business

I really wish I was able to get farther in one day, but I think it’s good enough that I went from idea to deployed app. On retrospective I wasted too much time figuring out formtastic. I don’t regret doing … Continue reading

Posted in other | Tagged , , , , | Leave a comment

Super Exception Notifier

I like knowing when something goes wrong with my web apps, so I’m using Super Exception Notifier to get by email a report should any exception be raised in the app. If you go to Super Exception Notifier’s site you’ll … Continue reading

Posted in other | Tagged , , , , | Leave a comment

Merging users

Remember that I said that when you log in, your ghost user has to be merged with the real user? Well, this is the code for doing it: class User < ActiveRecord::Base #… def merge(user_id) if user_id != nil user … Continue reading

Posted in other | Tagged , , , , | Leave a comment