Complex constraints for rails routes
It’s possible to use a custom class as a constraint for your routes. For example:
Continue readingIt’s possible to use a custom class as a constraint for your routes. For example:
Continue readingI’ve created a simple capistrano task to keep track of my deploys. When I deploy to a server, it will create a git tag and push it to origin. This way I can keep track of each deploy revision.
after 'deploy:update_code', 'git:create_deploy_tag'
namespace :git
task :create_deploy_tag do
puts "[git] creating new deploy tag"
tag_name = "deploy--#{Time.now.strftime("%Y-%m-%d-%H-%M-%S")}"
`git tag -a '#{tag_name}' -m 'Deploy: #{Time.now}' origin/production && git push origin --tags`
end
end
p.s: I use the production
branch as my deploy branch. You can change it for master, or anything else.
Here is some simple steps to access the phone camera and image gallery. This will be a very simple app. There is only one view, it will hold 2 buttons for selecting the image (one from camera and another from the gallery) and a ImageView that will show the selected image. I’ll not talk about the layout here, what I did is ugly and looks like this:
Continue readingI’m going to use the rails application I created on the post How to Build a Mobile Rails 3.1 App to create a simple android app. You probably can do this in less than 3 minutes, I guess.
This guide is good to get you started, but I consider it deprecated. I think the end result gives a bad user experience, since it will won’t behave as an proper mobile app, and it won’t also behave as a webpage. Worst place ever.
Continue readingI could not find a vagrant archlinux box, so I created one. It’s available on SourceForge. (Archlinux 2011.08.19)
It’s very easy to setup:
gem install vagrant
vagrant box add archlinux http://ftp.heanet.ie/mirrors/sourceforge/v/project/va/vagrantarchlinx/2011.08.19/archlinux_2011.08.19.box
vagrant init
vagrant up
You can download it manually too.
This is a simple guide to show how to use the Mobylette gem to make your Rails application respond to mobile and standard devices, and the jquery_mobile_rails gem to make it look awesome while doing that.
The final application’s source is available on Github. It is also running on heroku, if you want to check.
Continue readingI’ve created a very simple gem that includes the jquery mobile files to Rails’ assets pipeline. To install, just add to your Gemfile:
gem 'jquery_mobile_rails'
And require the javascript/css files in your manifests:
//= require jquery.mobile.min
*= require jquery.mobile.min
That’s it. No helpers, no methods, only the files in your application assets pipeline. For more information check the github repo.