Yet another BaseCamp Chrome extension
Available the dedicated Chrome Web Store page.
Have Fun
Mikamai developers blog
Yet another BaseCamp Chrome extension
Available the dedicated Chrome Web Store page.
Have Fun
elia:
Whenever you’re within some text in TextMate you can see the urls properly underlined. Today I finally (and accidentally) discovered how to open those urls in the browser.
The command is
⌅
and on my macbook can be reached by using togetherfn
and⏎
.Now that I know it I can start implementing the lynx bundle!
Ubuntu 12.04 setup (rbenv, janus, postgres)
Enjoy.
Another Ruby Social Club is coming!
Let’s help make this happen and propose a talk about cool stuff related to Ruby and/or Software/Hardware development.
As usual, it’s going to be held in the Mikamai HQ, Milan.
So, you want a quick and dirty way to obtain all the models in your Rails app that contain relations targeting a collection (like an has_many relation)?
Dir['app/models/**/*.rb'] .map {|model| File.basename(model, '.rb')} .map(&:camelize) .map(&:constantize) .select {|section| section.reflections.find {|name, reflection| reflection.collection? } }.map(&:to_s)
kind of.. ^_^
If your making an API and some methods of your controller doesn’t need to render anything peculiar, you could rely on the head method.
head :ok
For an exhaustive list of the rails mapping you can use the handy cheat gem, created by Josh Susser.
$ gem install cheat $ cheat status_codes status_codes: Use these codes for the #head or #render methods. ex: head :ok render :file => '404.html.erb', :status => :not_found status_codes: Use these codes for the #head or #render methods. ex: head :ok render :file => '404.html.erb', :status => :not_found 1xx Informational 100 => :continue 101 => :switching_protocols 102 => :processing 2xx Success 200 => :ok ...
The solutions provided and some benchmarking are available in this gist.