30 May '14, 1pm

How to Share a Session Between Sinatra and Rails

As Rails developers, we run into Sinatra apps all the time: gems such as Resque which expose a dashboard via Sinatra, legacy Sinatra apps that run alongside a main Rails app, and Sinatra APIs embedded within a Rails app, to name a few examples. Here’s a common problem: how do you share authentication between the apps? It would be really convenient to be able to do something like this in our Sinatra app: get '/dashboard' do if session[:user_id].present? redirect to('/') else # set up and render dashboard end end Both Rails and Sinatra are Rack-based, which makes them play surprisingly well together. They can be combined in two ways: via Rack::Builder or via the Rails routes. Rack::Builder This method treats Rails as just another Rack app. It creates a middleware stack and mounts the apps at particular urls # config.ru map '/api' do run MySinatraApp.new end map '/' do run My...

Full article: http://robots.thoughtbot.com/how-to-share-a-session-betwe...

Tweets

File download done right with Rails

therailsway.com 31 May '14, 9pm

Getting your file downloads right is one of the most important parts of your File Management functionality. A poorly imple...

Storing your files with Rails

therailsway.com 31 May '14, 9pm

This is the second article in my series on file management, the third article will cover the challenges of handling upload...

Building an Ember App with Rails

rubyflow.com 31 May '14, 3pm

Building an Ember App with Rails Posted by bcardarella on May 31, 2014 — 0 comments Part 4 Comments “ ” Post a Comment Com...

Thank you #Rails truncate!

api.rubyonrails.org 12 Jun '14, 12am

Highlights one or more phrases everywhere in text by inserting it into a :highlighter string. The highlighter can be speci...

RailsCastsのKaminari回見ました…… #githubkaigi

railscasts.com 01 Jun '14, 6am

If you need pagination in Rails 3 try out Kaminari. It is a clean, flexible solution which uses scopes to flow nicely with...

muito útil! #ruby #rails #rubyonrails

apidock.com 30 May '14, 2pm

Splits or iterates over the array in groups of size number, padding any remaining slots with

ember_simple_auth-rails (0.5.1): ember-simple-a...

rubygems.org 02 Jun '14, 11am

ember_simple_auth-rails 0.5.1 ember-simple-auth for the rails asset pipeline install gem install ember_simple_auth-rails D...

Paired Wind And Solar: Two Renewable Energy Sou...

solarindustrymag.com 31 May '14, 7pm

Spurred on by opportunity and the desire to maximize existing generating assets, several wind developers are now beginning...

has_zone (0.0.4): Provides a way to convert fro...

rubygems.org 31 May '14, 7pm

Provides a way to convert from TZinfo time zone identifer to ActiveSupport TimeZone for your Rails application.

“#swiftlang enums are taken directly from #rail...

api.rubyonrails.org 03 Jun '14, 4pm

Declare an enum attribute where the values map to integers in the database, but can be queried by name. Example: class Con...

Ruby on Rails: Screencasts

Ruby on Rails: Screencasts

rubyonrails.org 11 Jun '14, 10pm

Learning Rails the Zombie Way If you’re new to Rails and want to give it a try, then head over to RailsForZombies.org . Ra...

Segurança em Rails

akitaonrails.com 26 May '14, 10am

O assunto segurança é bem complicado, este post não tem a intenção de ser a fonte completa de tudo relacionado a segurança...

[GET] Viral Facebook Script 2014 (Share to View)

blackhatworld.com 01 Jun '14, 12pm

I have developed a cool Script for you guys. It's a Viral Script for Facebook. The Language is German now but I can change...

angular-strap-rails (2.0.1): AngularStrap for r...

rubygems.org 31 May '14, 11am

angular-strap-rails 2.0.1 AngularStrap for rails. install gem install angular-strap-rails Download Documentation Badge Sub...