Tiago Scolari

bits for fun

Mobylette: Mobile Requests Handling (GEM)

2011-09-03 Code

In the last few days have been working on this gem. It’s named Mobylette and it works by identifying mobile requests in your app, and handling them with a new .mobile format.

Once you have it installed on your application, adding respond_to_mobile_requests to your controller will enable it to deal with mobile requests. It will automatically look for a .mobile.erb (.haml, or whatever) when a request comes from a mobile device. Also you can call the mobile type from a respond_to block:

Continue reading

Uploadify on Rails, without rack middleware (using devise)

2011-03-31 Code

You can avoid the middleware hack when using flash in rails with logged in users.

As you should know, the browser doesn’t share the session with flash. Before using devise, I was using a rack middleware to hack into user session.

But there is a much cleaner way if you use devise, you can use the built in feature :authentication_token.

More details on how are here.

Newer posts