Custom validator for angularjs

0 notes

Print grape routes using rake task.

0 notes

Use http_basic with grape API layer.

0 notes

Migrating s3 data to the new account

Few days ago I needed to migrate s3 data from one account to another account. I’ve decided to use as background worker heroku server. And wrote this code below:

1 note

devise masquerade gem

Yesterday I published the simple gem for devise. Now it is easy to add ‘Login As’ functionality to your admin pages.

1. Add gem ‘devise_masquerade’ to your Gemfile.

2. Add before_filter :masquerade_user! to the application_controller.rb

3. Add link_to ‘Login As’, masquerade_path(user) to your table with users.

4. Use it :)


0 notes

deploy branch to the heroku

git push heroku branch-name:master
1 note

print sql queries in the console while debugging

rails code:

   class Post < ActiveRecord::Base
     def method1
       require 'ruby-debug'

In the debug session you should run the next following code:

  ActiveRecord::Base.logger =$stdout)

My ~/.rdebugrc

set autolist
set autoeval
set autoreload
0 notes