Ruby Quick Reference Guide. Here is a quick reference guide for Ruby developers: What is Ruby ?
Ruby is a pure object-oriented programming language. It was created in 1993 by Yukihiro Matsumoto of Japan. Ruby is a general-purpose, interpreted programming language like PERL and Python. What is IRb ? Interactive Ruby (IRb) provides a shell for experimentation. This tool comes along with Ruby installation so you have nothing to do extra to have IRb working. Ruby Syntax: Whitespace characters such as spaces and tabs are generally ignored in Ruby code, except when they appear in strings.Ruby interprets semicolons and newline characters as the ending of a statement.
Reserved words: The following list shows the reserved words in Ruby. Here Docs in Ruby: Here are different examples: #! Ruby Data Types: Basic types are numbers, strings, ranges, arrays, and hashes. TravisSwicegood.com. Rails setup for V6 (multiple) · blueimp/jQuery-File-Upload Wiki. Prerequisites have jQuery setup in your appcopy jQuery File Upload files in the proper directories of your Rails app Models For use with the Carrierwave gem We'll use basic Carrierwave uploader: class AvatarUploader < CarrierWave::Uploader::Base storage :file def store_dir "uploads/#{model.class.to_s.underscore}/#{mounted_as}/#{model.id}" endend Let's set up a Picture model For use with the Dragonfly gem set up a Picture model (make sure you have both avatar_uid and avatar_name columns in your database) Controller First one controller to handle the downloads: (html response is for browsers using iframe sollution) And it's routes: resources :pictures, :only => [:index, :create, :destroy] Let's play In whatever view file you want, copy paste this code and enjoy.
RailsInstaller. Installing rails 4.0.0 beta. Ruby - Rails 3. Creating a production database. Get Your App Ready for Rails 4RubySource. A new Rails version is about to be released and it’s coming with many changes, deprecations, and new features.
Lets take a look at what you need to do to get your app ready for Rails 4. The Path to Upgrade. Mkdynamic/omniauth-facebook. #360 Facebook Authentication. OmniAuth: Overview · plataformatec/devise Wiki. Since version 1.2, Devise supports integration with OmniAuth.
This wiki page will cover the basics to have this integration working using an OAuth provider as example. Since version 1.5, Devise supports OmniAuth 1.0 forward which will be the version covered by this tutorial. Before you start Remember that config.omniauth adds omniauth provider middleware to your application. This means you should not add this provider middleware again in config/initializers/omniauth.rb as they'll clash with each other and result in always-failing authentication.
Facebook example The first step then is to add an OmniAuth gem to your application. Gem 'omniauth-facebook' Here we'll use Facebook as an example, but you are free to use whatever and as many OmniAuth gems as you'd like. Next up, you should add the columns "provider" and "uid" to your User model. rails g migration AddColumnsToUsers provider uid rake db:migrate require "omniauth-facebook"config.omniauth :facebook, "APP_ID", "APP_SECRET" Logout links.
Ruby on rails - undefined local variable or method `confirmed_at' for #User. Rails/sass-rails. The Lowdown on Routes in Rails 3. Today's blog post is by a guest community contributor, [Rizwan Reza]( Rizwan is an active member of the Rails community, and as of late, has been working to clean up the overgrown Lighthouse queue.
We're happy to have him write for those seeking advice on deploying on a [Platform as a Service]( Stop! I'd like to tell you something important, but it may be a bit shocking, so you should probably have a seat. Here goes: everything you knew about working with routes in Rails 2... is history! With Rails 3, you've got to roll up your sleeves, unlearn what you learned, and route the new way around.
In this post, we'll walk through the underpinnings of Routes in Rails 3. Let's start by looking at some code; here's the new DSL, in its full glory: resources :products do resource :category member do post :short end collection do get :long endend match "/posts/github" => redirect(" Now check out the old way of doing it: As you can see, the example from Rails 3 is much cleaner and more Rubyish. Keys. 2012 Rails Rumble.