<?xml version='1.0' encoding='UTF-8'?><?xml-stylesheet href="http://www.blogger.com/styles/atom.css" type="text/css"?><feed xmlns='http://www.w3.org/2005/Atom' xmlns:openSearch='http://a9.com/-/spec/opensearchrss/1.0/' xmlns:blogger='http://schemas.google.com/blogger/2008' xmlns:georss='http://www.georss.org/georss' xmlns:gd="http://schemas.google.com/g/2005" xmlns:thr='http://purl.org/syndication/thread/1.0'><id>tag:blogger.com,1999:blog-2936127337406425108</id><updated>2026-10-10T11:46:00.417+05:30</updated><category term="ruby"/><category term="actionmailer"/><category term="email in ruby"/><category term="email rails"/><category term="emails"/><category term="git"/><category term="gmail email in ruby"/><category term="html email in ror"/><category term="rubymotion"/><category term="Phonegap"/><category term="accepts_nested_attributes_for"/><category term="actionmailer 2.3.9"/><category term="android emulator setu"/><category term="android rhomobile setup"/><category term="apple application"/><category term="bitbucket"/><category term="bitucket git merge"/><category term="bootstrap"/><category term="branches"/><category term="capd install git clone"/><category term="capistrano"/><category term="clone git branch"/><category term="cloning a branch git"/><category term="dropbox-rails"/><category term="excel export rails"/><category term="excel export rails 3"/><category term="excel export ror"/><category term="excel export ruby"/><category term="file-storage-rails"/><category term="frank-cucumber"/><category term="frank-cucumber rubymotion"/><category term="git branch merge"/><category term="git capistrano"/><category term="git clone"/><category term="git clone branch"/><category term="git clone too many arguments"/><category term="git fatal reference. git submodule fatal reference. git branch fatal reference"/><category term="git issues"/><category term="git merge"/><category term="git repo from svn"/><category term="git svn clone"/><category term="helpful jenkins plugins"/><category term="heroku readline"/><category term="html5 native ios app"/><category term="imagemagick"/><category term="install ruby"/><category term="ios"/><category term="ios app"/><category term="ios html phonegap app"/><category term="ios native application"/><category term="jdbc mac"/><category term="jdbc ruby"/><category term="jenkins"/><category term="jenkins plugins"/><category term="merge"/><category term="merge master"/><category term="merge repositories"/><category term="metasearch rails 3.1"/><category term="metawhere"/><category term="migrate svn repo"/><category term="migrating repositories"/><category term="motion-frank"/><category term="move svn to git"/><category term="multi-model-forms"/><category term="natiive ios app"/><category term="nested-forms"/><category term="nested_form"/><category term="os mac"/><category term="paperclip"/><category term="paperclip-dropbox"/><category term="photo-upload"/><category term="push to git from svn"/><category term="rails"/><category term="rails email"/><category term="rails mobile"/><category term="rails mobile app ubuntu"/><category term="rails search"/><category term="rails ubuntu mobile"/><category term="rails-nested-forms"/><category term="rails-paperclip"/><category term="readline"/><category term="readline error"/><category term="remotes"/><category term="rename a branch git. git branch"/><category term="rhodes gem"/><category term="rhomobile"/><category term="rhomobile android"/><category term="rmagic"/><category term="rmagick"/><category term="ror search"/><category term="ror search squeel"/><category term="ruby 1.9.3 install"/><category term="ruby 193"/><category term="ruby email"/><category term="ruby gmail actionmailer"/><category term="ruby install linux"/><category term="ruby install ubuntu"/><category term="ruby install windows"/><category term="ruby linux"/><category term="ruby mac"/><category term="ruby mobile"/><category term="ruby on mac os"/><category term="ruby on rails"/><category term="ruby on rails install"/><category term="ruby on rails linux"/><category term="ruby on rails mac"/><category term="ruby on rails rvm mac"/><category term="ruby on rails search"/><category term="ruby on ubuntu"/><category term="ruby rvm"/><category term="ruby187"/><category term="rubymotion acceptance testing"/><category term="rubymotion cucumber"/><category term="rubymotion frank"/><category term="rubymotion ios ruby cocoa"/><category term="rvm install ruby on mac os"/><category term="rvm readline"/><category term="rvm ruby ubuntu install"/><category term="search rails 3.1"/><category term="search ruby"/><category term="send email"/><category term="squeel"/><category term="svn git migration"/><category term="svn git repo migration"/><category term="svn to git"/><category term="ubuntu"/><category term="ubuntu 12.04 install ruby"/><category term="ubuntu mobile application"/><category term="ubuntu readline"/><category term="ubuntu rhomobile"/><category term="xls export in ror"/><category term="xls export in ruby"/><category term="xls export rails"/><category term="xls export rails 3"/><title type='text'>Ruby on Rails Tutorials</title><subtitle type='html'>Please visit my website &lt;a href=&quot;http://ashish-upadhyay.com&quot;&gt;www.ashish-upadhyay.com&lt;/a&gt;</subtitle><link rel='http://schemas.google.com/g/2005#feed' type='application/atom+xml' href='http://rorashish.blogspot.com/feeds/posts/default'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/2936127337406425108/posts/default?redirect=false'/><link rel='alternate' type='text/html' href='http://rorashish.blogspot.com/'/><link rel='hub' href='http://pubsubhubbub.appspot.com/'/><author><name>Anonymous</name><uri>http://www.blogger.com/profile/14643110071701140642</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='16' height='16' src='https://img1.blogblog.com/img/b16-rounded.gif'/></author><generator version='7.00' uri='http://www.blogger.com'>Blogger</generator><openSearch:totalResults>24</openSearch:totalResults><openSearch:startIndex>1</openSearch:startIndex><openSearch:itemsPerPage>25</openSearch:itemsPerPage><entry><id>tag:blogger.com,1999:blog-2936127337406425108.post-7181929744690117448</id><published>2014-11-15T03:38:00.000+05:30</published><updated>2014-11-15T03:38:09.498+05:30</updated><category scheme="http://www.blogger.com/atom/ns#" term="bitbucket"/><category scheme="http://www.blogger.com/atom/ns#" term="bitucket git merge"/><category scheme="http://www.blogger.com/atom/ns#" term="branches"/><category scheme="http://www.blogger.com/atom/ns#" term="git"/><category scheme="http://www.blogger.com/atom/ns#" term="git branch merge"/><category scheme="http://www.blogger.com/atom/ns#" term="git merge"/><category scheme="http://www.blogger.com/atom/ns#" term="merge"/><category scheme="http://www.blogger.com/atom/ns#" term="merge repositories"/><category scheme="http://www.blogger.com/atom/ns#" term="remotes"/><title type='text'>Merging branches on two different remotes GIT</title><content type='html'>&lt;div dir=&quot;ltr&quot; style=&quot;text-align: left;&quot; trbidi=&quot;on&quot;&gt;
Steps to merge branches located on two different remotes.&lt;br /&gt;
&lt;br /&gt;
In this example lets consider we have a repo on both and Github &amp;amp; BitBucket :&lt;br /&gt;
&lt;br /&gt;
&lt;b&gt;Step 1: Clone the repo which you want finally to hold all the changes.&lt;/b&gt;&lt;br /&gt;
&lt;br /&gt;
I will choose Github&lt;br /&gt;
&lt;blockquote class=&quot;tr_bq&quot;&gt;
git clone &amp;lt;repo URL&amp;gt;&lt;/blockquote&gt;
&lt;br /&gt;
&lt;b&gt;Step 2: Add remote for Bitbucket or other repo into the cloned repo&lt;/b&gt;&lt;br /&gt;
&lt;blockquote class=&quot;tr_bq&quot;&gt;
git remote add origin_bitbucket &amp;lt;url&amp;gt;&lt;/blockquote&gt;
&lt;br /&gt;
&lt;b&gt;Step 3: Checkout the branch from Bit Bucket remote&amp;nbsp;&lt;/b&gt;&lt;br /&gt;
&lt;blockquote class=&quot;tr_bq&quot;&gt;
git checkout origin_bitbucket/&amp;lt;branch name&amp;gt;&lt;/blockquote&gt;
&lt;br /&gt;
&lt;b&gt;Step 4: Check out the branch you want to merge into&lt;/b&gt;&lt;br /&gt;
&lt;blockquote class=&quot;tr_bq&quot;&gt;
git checkout origin/master&lt;/blockquote&gt;
&lt;br /&gt;
&lt;b&gt;Step 5: Merge BitBucket branch into it&lt;/b&gt;&lt;br /&gt;
&lt;blockquote class=&quot;tr_bq&quot;&gt;
git merge origin_bitbucket/&amp;lt;branch name&amp;gt;&lt;/blockquote&gt;
&lt;/div&gt;
</content><link rel='replies' type='application/atom+xml' href='http://rorashish.blogspot.com/feeds/7181929744690117448/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://rorashish.blogspot.com/2014/11/merging-branches-on-two-different.html#comment-form' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/2936127337406425108/posts/default/7181929744690117448'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/2936127337406425108/posts/default/7181929744690117448'/><link rel='alternate' type='text/html' href='http://rorashish.blogspot.com/2014/11/merging-branches-on-two-different.html' title='Merging branches on two different remotes GIT'/><author><name>Anonymous</name><uri>http://www.blogger.com/profile/14643110071701140642</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='16' height='16' src='https://img1.blogblog.com/img/b16-rounded.gif'/></author><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-2936127337406425108.post-5160846383358425384</id><published>2014-06-08T09:53:00.001+05:30</published><updated>2014-06-08T09:55:23.336+05:30</updated><category scheme="http://www.blogger.com/atom/ns#" term="git fatal reference. git submodule fatal reference. git branch fatal reference"/><category scheme="http://www.blogger.com/atom/ns#" term="git issues"/><title type='text'>Git fatal reference error on deployment or submodule update</title><content type='html'>&lt;div dir=&quot;ltr&quot; style=&quot;text-align: left;&quot; trbidi=&quot;on&quot;&gt;
&lt;b&gt;Sometimes we face this issue with GIT&lt;/b&gt;&lt;br /&gt;
&lt;blockquote class=&quot;tr_bq&quot; style=&quot;text-align: left;&quot;&gt;
&lt;span style=&quot;background-color: #cccccc; font-family: &#39;lucida grande&#39;, &#39;Lucida Sans Unicode&#39;, tahoma, sans-serif; font-size: 13px; line-height: 22.440000534057617px;&quot;&gt;fatal: reference is not a tree: d80ee5f27b06e84d40a7d2758525b682aaba7d72&lt;/span&gt;&lt;/blockquote&gt;
This is because the module has not been pushed to the main repo or the branch has not been pulled on the machine the command is being executed.&lt;br /&gt;
&lt;br /&gt;
&lt;span style=&quot;background-color: #eeeeee;&quot;&gt;Branch issues&amp;nbsp;&lt;/span&gt;&lt;br /&gt;
&lt;blockquote class=&quot;tr_bq&quot;&gt;
git checkout master&lt;br /&gt;
git fetch origin&lt;/blockquote&gt;
&lt;h4 style=&quot;text-align: left;&quot;&gt;
&lt;span style=&quot;background-color: #eeeeee;&quot;&gt;
Submodule issues&lt;/span&gt;&lt;/h4&gt;
&lt;blockquote class=&quot;tr_bq&quot;&gt;
git submodule update&lt;/blockquote&gt;
&lt;/div&gt;
</content><link rel='replies' type='application/atom+xml' href='http://rorashish.blogspot.com/feeds/5160846383358425384/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://rorashish.blogspot.com/2014/06/git-fatal-reference-error-on-deployment.html#comment-form' title='1 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/2936127337406425108/posts/default/5160846383358425384'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/2936127337406425108/posts/default/5160846383358425384'/><link rel='alternate' type='text/html' href='http://rorashish.blogspot.com/2014/06/git-fatal-reference-error-on-deployment.html' title='Git fatal reference error on deployment or submodule update'/><author><name>Anonymous</name><uri>http://www.blogger.com/profile/14643110071701140642</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='16' height='16' src='https://img1.blogblog.com/img/b16-rounded.gif'/></author><thr:total>1</thr:total></entry><entry><id>tag:blogger.com,1999:blog-2936127337406425108.post-7206245786930424893</id><published>2014-06-08T09:45:00.002+05:30</published><updated>2014-06-08T09:45:37.730+05:30</updated><category scheme="http://www.blogger.com/atom/ns#" term="helpful jenkins plugins"/><category scheme="http://www.blogger.com/atom/ns#" term="jenkins"/><category scheme="http://www.blogger.com/atom/ns#" term="jenkins plugins"/><title type='text'>Best Jenkins Plugins I use !</title><content type='html'>&lt;div dir=&quot;ltr&quot; style=&quot;text-align: left;&quot; trbidi=&quot;on&quot;&gt;
&lt;h3 style=&quot;text-align: left;&quot;&gt;
&lt;br /&gt;&lt;/h3&gt;
&lt;div style=&quot;text-align: left;&quot;&gt;
&lt;/div&gt;
&lt;h4 style=&quot;text-align: left;&quot;&gt;
1. Compress Artifacts Plugin&lt;/h4&gt;
&lt;blockquote class=&quot;tr_bq&quot;&gt;
Keeps build artifacts compressed to save disk space on the master.&amp;nbsp;&lt;/blockquote&gt;
&lt;h4 style=&quot;text-align: left;&quot;&gt;
2. Copy To Slave Plugin&lt;/h4&gt;
&lt;blockquote class=&quot;tr_bq&quot;&gt;
This plugin allows copying files located somewhere on the master node into the jobs&#39; workspaces, whether their builds take place on the master node or on slave nodes.&amp;nbsp;&lt;/blockquote&gt;
&lt;h4 style=&quot;text-align: left;&quot;&gt;
3. Cucumber Reports Plugin&lt;/h4&gt;
&lt;blockquote class=&quot;tr_bq&quot;&gt;
This plugin creates pretty cucumber-jvm html reports on jenkins&amp;nbsp;&lt;/blockquote&gt;
&lt;h4 style=&quot;text-align: left;&quot;&gt;
4. Delete log&lt;/h4&gt;
&lt;blockquote class=&quot;tr_bq&quot;&gt;
This plugin add action delete log to build page. If the build is build of matrix job, the action delete log for all its configurations too.&amp;nbsp;&lt;/blockquote&gt;
&lt;h4 style=&quot;text-align: left;&quot;&gt;
5. Green Balls&lt;/h4&gt;
&lt;blockquote class=&quot;tr_bq&quot;&gt;
Because green is better than blue! For color blind support configure user property.&amp;nbsp;&lt;/blockquote&gt;
&lt;h4 style=&quot;text-align: left;&quot;&gt;
6. HTML Publisher plugin&lt;/h4&gt;
&lt;blockquote class=&quot;tr_bq&quot;&gt;
This plugin publishes HTML reports.&amp;nbsp;&lt;/blockquote&gt;
&lt;h4 style=&quot;text-align: left;&quot;&gt;
7. Jenkins disk-usage plugin&lt;/h4&gt;
&lt;blockquote class=&quot;tr_bq&quot;&gt;
This plugin counts disk usage.&amp;nbsp;&lt;/blockquote&gt;
&lt;h4 style=&quot;text-align: left;&quot;&gt;
8. Jenkins Gravatar plugin&lt;/h4&gt;
&lt;blockquote class=&quot;tr_bq&quot;&gt;
This plugin shows Gravatar avatar images for Jenkins users.&amp;nbsp;&lt;/blockquote&gt;
&lt;h4 style=&quot;text-align: left;&quot;&gt;
9. Timestamper&lt;/h4&gt;
&lt;blockquote class=&quot;tr_bq&quot;&gt;
Adds timestamps to the Console Output.&amp;nbsp;&lt;/blockquote&gt;
&lt;br /&gt;
&lt;h4 style=&quot;text-align: left;&quot;&gt;
10. embeddable-build-status&lt;/h4&gt;
&lt;blockquote class=&quot;tr_bq&quot;&gt;
This plugin adds the embeddable build status badge to Jenkins so that you can easily hyperlink/show your build status from elsewhere.&amp;nbsp;&lt;/blockquote&gt;
&lt;/div&gt;
</content><link rel='replies' type='application/atom+xml' href='http://rorashish.blogspot.com/feeds/7206245786930424893/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://rorashish.blogspot.com/2014/06/best-jenkins-plugins-i-use.html#comment-form' title='1 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/2936127337406425108/posts/default/7206245786930424893'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/2936127337406425108/posts/default/7206245786930424893'/><link rel='alternate' type='text/html' href='http://rorashish.blogspot.com/2014/06/best-jenkins-plugins-i-use.html' title='Best Jenkins Plugins I use !'/><author><name>Anonymous</name><uri>http://www.blogger.com/profile/14643110071701140642</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='16' height='16' src='https://img1.blogblog.com/img/b16-rounded.gif'/></author><thr:total>1</thr:total></entry><entry><id>tag:blogger.com,1999:blog-2936127337406425108.post-3774173540038238952</id><published>2014-06-08T09:05:00.000+05:30</published><updated>2014-06-08T09:10:27.543+05:30</updated><category scheme="http://www.blogger.com/atom/ns#" term="frank-cucumber"/><category scheme="http://www.blogger.com/atom/ns#" term="frank-cucumber rubymotion"/><category scheme="http://www.blogger.com/atom/ns#" term="ios"/><category scheme="http://www.blogger.com/atom/ns#" term="motion-frank"/><category scheme="http://www.blogger.com/atom/ns#" term="rubymotion"/><category scheme="http://www.blogger.com/atom/ns#" term="rubymotion acceptance testing"/><category scheme="http://www.blogger.com/atom/ns#" term="rubymotion cucumber"/><category scheme="http://www.blogger.com/atom/ns#" term="rubymotion frank"/><title type='text'>Using Frank with Rubymotion</title><content type='html'>&lt;div dir=&quot;ltr&quot; style=&quot;text-align: left;&quot; trbidi=&quot;on&quot;&gt;
&lt;h4 style=&quot;text-align: left;&quot;&gt;
&lt;/h4&gt;
&lt;h3 style=&quot;text-align: left;&quot;&gt;
Writing acceptance tests for iOS application in Rubymotion&lt;/h3&gt;
Steps involved&lt;br /&gt;
&lt;div style=&quot;text-align: left;&quot;&gt;
&lt;br /&gt;&lt;/div&gt;
1) &lt;b&gt;Add the &lt;a href=&quot;https://github.com/cyrusinnovation/motion-frank&quot; target=&quot;_blank&quot;&gt;motion-frank&lt;/a&gt; gem to the Gemfile&lt;/b&gt;&lt;br /&gt;
2) &lt;b&gt;Run the initializer&amp;nbsp;&lt;span style=&quot;background-color: #f8f8f8; color: #333333; font-family: Consolas, &#39;Liberation Mono&#39;, Menlo, Courier, monospace; font-size: 13px; line-height: 19px;&quot;&gt;rake frank:init_features&lt;/span&gt;&lt;/b&gt;&lt;br /&gt;
&lt;div style=&quot;text-align: left;&quot;&gt;
&lt;span style=&quot;font-family: inherit;&quot;&gt;3) &lt;b&gt;Now you have the features directory.&lt;/b&gt;&lt;/span&gt;&lt;/div&gt;
&lt;div style=&quot;text-align: left;&quot;&gt;
&lt;span style=&quot;font-family: inherit;&quot;&gt;4) &lt;b&gt;Write a sample test&lt;/b&gt;&lt;/span&gt;&lt;/div&gt;
&lt;div style=&quot;text-align: left;&quot;&gt;
&lt;span style=&quot;font-family: inherit;&quot;&gt;&lt;br /&gt;&lt;/span&gt;&lt;/div&gt;
&lt;div style=&quot;text-align: left;&quot;&gt;
&lt;span style=&quot;font-family: inherit;&quot;&gt;&lt;b&gt;eg:&amp;nbsp;&lt;/b&gt;&lt;/span&gt;&lt;/div&gt;
&lt;blockquote class=&quot;tr_bq&quot;&gt;
&lt;span style=&quot;background-color: #eeeeee;&quot;&gt;Feature: Navigating around the app / smoke test&lt;/span&gt;&lt;br /&gt;
&lt;span style=&quot;background-color: #eeeeee;&quot;&gt;&amp;nbsp; As a user&lt;/span&gt;&lt;br /&gt;
&lt;span style=&quot;background-color: #eeeeee;&quot;&gt;&amp;nbsp; I want to be able to get to all parts of the app&lt;/span&gt;&lt;br /&gt;
&lt;span style=&quot;background-color: #eeeeee;&quot;&gt;&amp;nbsp; So I can use it and not get confused or lost&lt;/span&gt;&lt;/blockquote&gt;
&lt;blockquote class=&quot;tr_bq&quot;&gt;
&lt;span style=&quot;background-color: #eeeeee;&quot;&gt;Background:&lt;/span&gt;&lt;br /&gt;
&lt;span style=&quot;background-color: #eeeeee;&quot;&gt;&amp;nbsp; Given I launch the app&lt;/span&gt;&lt;br /&gt;
&lt;span style=&quot;background-color: #eeeeee;&quot;&gt;&amp;nbsp; Given I am on the search Screen with empty search&lt;/span&gt;&lt;/blockquote&gt;
&lt;blockquote class=&quot;tr_bq&quot;&gt;
&lt;span style=&quot;background-color: #eeeeee;&quot;&gt;Scenario: Search&lt;/span&gt;&lt;br /&gt;
&lt;span style=&quot;background-color: #eeeeee;&quot;&gt;&amp;nbsp; Given I am on the search screen&lt;/span&gt;&lt;br /&gt;
&lt;span style=&quot;background-color: #eeeeee;&quot;&gt;&amp;nbsp; Then I should see a navigation bar with label text &quot;Search&quot;&lt;/span&gt;&lt;br /&gt;
&lt;span style=&quot;background-color: #eeeeee;&quot;&gt;&amp;nbsp; When I fill in a search term&lt;/span&gt;&lt;br /&gt;
&lt;span style=&quot;background-color: #eeeeee;&quot;&gt;&amp;nbsp; Then I should see a navigation bar with label text &quot;Results&quot;&lt;/span&gt;&lt;/blockquote&gt;
&lt;div style=&quot;text-align: left;&quot;&gt;
&lt;span style=&quot;font-family: inherit;&quot;&gt;5) &lt;b&gt;Save this as a xyz.feature file&lt;/b&gt;&lt;/span&gt;&lt;/div&gt;
&lt;div style=&quot;text-align: left;&quot;&gt;
6) &lt;b&gt;Run rake frank to see this test fail&lt;/b&gt;&lt;/div&gt;
&lt;div style=&quot;text-align: left;&quot;&gt;
7) &lt;b&gt;Add the step definition file in the features/step_definitions named something like xyz_steps.rb&lt;/b&gt;&lt;/div&gt;
&lt;div style=&quot;text-align: left;&quot;&gt;
8) &lt;b&gt;Add step methods describing the steps and what should happen on the simulator to match the test.&amp;nbsp;&lt;/b&gt;&lt;/div&gt;
&lt;div style=&quot;text-align: left;&quot;&gt;
&lt;br /&gt;&lt;/div&gt;
&lt;div style=&quot;text-align: left;&quot;&gt;
eg.&lt;/div&gt;
&lt;blockquote class=&quot;tr_bq&quot;&gt;
&lt;span style=&quot;background-color: #eeeeee;&quot;&gt;Given(/^I am on the search Screen with empty search$/) do&lt;/span&gt;&lt;br /&gt;
&lt;span style=&quot;background-color: #eeeeee;&quot;&gt;&amp;nbsp; wait_for_element_to_exist_and_then_touch_it(&quot;textField placeholder:&#39;Search by name&#39;&quot;)&lt;/span&gt;&lt;br /&gt;
&lt;span style=&quot;background-color: #eeeeee;&quot;&gt;end&lt;/span&gt;&lt;/blockquote&gt;
&lt;blockquote class=&quot;tr_bq&quot;&gt;
&lt;span style=&quot;background-color: #eeeeee;&quot;&gt;&lt;br /&gt;&lt;/span&gt;
&lt;span style=&quot;background-color: #eeeeee;&quot;&gt;Given(/^I am on the search screen$/) do&lt;/span&gt;&lt;br /&gt;
&lt;span style=&quot;background-color: #eeeeee;&quot;&gt;&amp;nbsp; check_element_exists(&quot;textField placeholder:&#39;Search by name&#39;&quot;)&lt;/span&gt;&lt;br /&gt;
&lt;span style=&quot;background-color: #eeeeee;&quot;&gt;end&amp;nbsp;&lt;/span&gt;&lt;/blockquote&gt;
&lt;br /&gt;
and go on ....&lt;br /&gt;
&lt;br /&gt;
Go through the sameple steps and implementation in the frank-cucumber library to get hold of more methods to test the UI.&lt;br /&gt;
&lt;br /&gt;
&lt;span style=&quot;background-color: #f3f3f3; color: blue;&quot;&gt;Also you can use rake frank:symbiote to get the list of UI elements accessible for testing in a simulator.&lt;/span&gt;&lt;br /&gt;
&lt;span style=&quot;background-color: #f3f3f3;&quot;&gt;&lt;span style=&quot;color: blue;&quot;&gt;&lt;br /&gt;&lt;/span&gt;
&lt;span style=&quot;color: blue;&quot;&gt;Run &quot;rake frank:symbiote&quot; in the Rubymotion directory and once the simulator is up with the application open the browser and navigate to &quot;localhost:37265&quot;&amp;nbsp;&lt;/span&gt;&lt;/span&gt;&lt;br /&gt;
&lt;br /&gt;
&lt;b&gt;Quick Tips :&amp;nbsp;&lt;/b&gt;&lt;br /&gt;
&lt;br /&gt;
1) For ruby code which like occurs in multiple step file , write ruby files in the support folder such as&lt;br /&gt;
&lt;blockquote class=&quot;tr_bq&quot;&gt;
def check_search_bar&lt;br /&gt;
&amp;nbsp; check_element_exists(&quot;textField placeholder:&#39;Search by name&#39;&quot;)&lt;br /&gt;
end&lt;/blockquote&gt;
Now you can use this check_search_bar method in any step definition file &amp;amp; reduce the amount of code you write to get your code working.&lt;br /&gt;
&lt;h3 style=&quot;text-align: left;&quot;&gt;
&lt;span style=&quot;background-color: #f3f3f3; color: blue;&quot;&gt;&lt;br /&gt;Happy Testing with cucumber !! Its fun.&amp;nbsp;&lt;/span&gt;&lt;/h3&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;&lt;/div&gt;
</content><link rel='replies' type='application/atom+xml' href='http://rorashish.blogspot.com/feeds/3774173540038238952/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://rorashish.blogspot.com/2014/06/using-frank-with-rubymotion.html#comment-form' title='2 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/2936127337406425108/posts/default/3774173540038238952'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/2936127337406425108/posts/default/3774173540038238952'/><link rel='alternate' type='text/html' href='http://rorashish.blogspot.com/2014/06/using-frank-with-rubymotion.html' title='Using Frank with Rubymotion'/><author><name>Anonymous</name><uri>http://www.blogger.com/profile/14643110071701140642</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='16' height='16' src='https://img1.blogblog.com/img/b16-rounded.gif'/></author><thr:total>2</thr:total></entry><entry><id>tag:blogger.com,1999:blog-2936127337406425108.post-1632630821592939276</id><published>2013-04-30T03:22:00.000+05:30</published><updated>2013-04-30T03:22:19.540+05:30</updated><category scheme="http://www.blogger.com/atom/ns#" term="rubymotion ios ruby cocoa"/><title type='text'>Starting With Rubymotion</title><content type='html'>&lt;div dir=&quot;ltr&quot; style=&quot;text-align: left;&quot; trbidi=&quot;on&quot;&gt;
&lt;br /&gt;&lt;br /&gt;
&lt;h2 style=&quot;text-align: left;&quot;&gt;
&lt;span style=&quot;font-size: large;&quot;&gt;&lt;b&gt;&lt;a href=&quot;http://www.rubymotion.com/&quot; target=&quot;_blank&quot;&gt;Rubymotion&lt;/a&gt;&lt;/b&gt;&lt;/span&gt;&lt;/h2&gt;
&lt;blockquote class=&quot;tr_bq&quot;&gt;
&amp;nbsp;RubyMotion is a revolutionary toolchain for iOS.&lt;br /&gt;
It lets you quickly develop and test native iOS applications for iPhone or iPad, all using the awesome Ruby language you know and love. &lt;/blockquote&gt;
&lt;br /&gt;
&lt;a name=&#39;more&#39;&gt;&lt;/a&gt;&amp;nbsp;&lt;span style=&quot;font-size: large;&quot;&gt;&lt;b&gt;To start with Rubymotion we would need&lt;/b&gt;&lt;/span&gt;&lt;br /&gt;
&lt;br /&gt;
&lt;ol style=&quot;text-align: left;&quot;&gt;
&lt;li&gt;A Mac &lt;/li&gt;
&lt;li&gt;Ruby&lt;/li&gt;
&lt;li&gt;xCode &lt;/li&gt;
&lt;li&gt;Command Line Build Tools&lt;/li&gt;
&lt;li&gt;Rubymotion&lt;/li&gt;
&lt;li&gt;Text editor&lt;/li&gt;
&lt;li&gt;Little knowledge of the Cocoa API&#39;s&lt;/li&gt;
&lt;li&gt;Faith, Hope and Goodwill &lt;/li&gt;
&lt;/ol&gt;
Assumming that the setup is done without any issues, Lets start &lt;br /&gt;
&lt;br /&gt;
&lt;b&gt;Check for an update for the Rubymotion installer&lt;/b&gt;&lt;br /&gt;
&lt;blockquote class=&quot;tr_bq&quot;&gt;
&lt;b&gt;&lt;span style=&quot;background-color: #cccccc;&quot;&gt;sudo motion update&lt;/span&gt;&lt;/b&gt;&lt;/blockquote&gt;
&lt;div class=&quot;separator&quot; style=&quot;clear: both; text-align: center;&quot;&gt;
&lt;/div&gt;
&lt;div class=&quot;separator&quot; style=&quot;clear: both; text-align: center;&quot;&gt;
&lt;a href=&quot;https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEifBIrl-WvHfMIcav9GNby975B0W7b2pAgUMbcSYx9pbyOv3-ZjP5GWsii0A1h_F4lfpnTQwBBE4BF_Q1SAyNegIN6KsU0l8Kc-fGg8ItuuW1dh8WH98THuPMcpviRo_o0yAoqIHPyko0Nd/s1600/rm-update.png&quot; imageanchor=&quot;1&quot; style=&quot;clear: left; float: left; margin-bottom: 1em; margin-right: 1em;&quot;&gt;&lt;img border=&quot;0&quot; height=&quot;112&quot; src=&quot;https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEifBIrl-WvHfMIcav9GNby975B0W7b2pAgUMbcSYx9pbyOv3-ZjP5GWsii0A1h_F4lfpnTQwBBE4BF_Q1SAyNegIN6KsU0l8Kc-fGg8ItuuW1dh8WH98THuPMcpviRo_o0yAoqIHPyko0Nd/s640/rm-update.png&quot; width=&quot;640&quot; /&gt;&lt;/a&gt;&amp;nbsp;&lt;/div&gt;
&lt;b&gt;Creating our first application&lt;/b&gt;&lt;br /&gt;
&lt;blockquote class=&quot;tr_bq&quot;&gt;
&lt;b&gt;&lt;span style=&quot;background-color: #cccccc;&quot;&gt;motion create RssReader&lt;/span&gt;&lt;/b&gt; &lt;/blockquote&gt;
&lt;div class=&quot;separator&quot; style=&quot;clear: both; text-align: center;&quot;&gt;
&lt;a href=&quot;https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEgShZP4GN6vIY5sbW06gApq7uv0J7uHGuDXdTjY2xoSt_Bhdi1SRroM8wK_HY72tbFzFpVagPtJxAr77CS1TxQLZFokTQPvlpIYz6BRbY8K69akED9M2PIsRCORqU8aHO-y648HLNdErmke/s1600/rm-create.png&quot; imageanchor=&quot;1&quot; style=&quot;clear: left; float: left; margin-bottom: 1em; margin-right: 1em;&quot;&gt;&lt;img border=&quot;0&quot; height=&quot;226&quot; src=&quot;https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEgShZP4GN6vIY5sbW06gApq7uv0J7uHGuDXdTjY2xoSt_Bhdi1SRroM8wK_HY72tbFzFpVagPtJxAr77CS1TxQLZFokTQPvlpIYz6BRbY8K69akED9M2PIsRCORqU8aHO-y648HLNdErmke/s640/rm-create.png&quot; width=&quot;640&quot; /&gt;&lt;/a&gt;&lt;/div&gt;
&lt;div class=&quot;separator&quot; style=&quot;clear: both; text-align: center;&quot;&gt;
&lt;br /&gt;&lt;/div&gt;
Structure of the Rubymotion application&lt;br /&gt;
&lt;div class=&quot;separator&quot; style=&quot;clear: both; text-align: center;&quot;&gt;
&lt;a href=&quot;https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEjHFtUNvgDM7m5feFw6uqNfHMvXSbgcJjkzpvQzuB2iRjkO8-mDxiLtBaxIusMpis5vPle-4oBHHzMsNqRsV8UyJEhwHehyphenhyphenuZChqi94AGregtSqxO8Hzv-SJ7PzlFYT0PEk22D5us5BnKeE/s1600/rm-structure.png&quot; imageanchor=&quot;1&quot; style=&quot;clear: left; float: left; margin-bottom: 1em; margin-right: 1em;&quot;&gt;&lt;img border=&quot;0&quot; height=&quot;198&quot; src=&quot;https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEjHFtUNvgDM7m5feFw6uqNfHMvXSbgcJjkzpvQzuB2iRjkO8-mDxiLtBaxIusMpis5vPle-4oBHHzMsNqRsV8UyJEhwHehyphenhyphenuZChqi94AGregtSqxO8Hzv-SJ7PzlFYT0PEk22D5us5BnKeE/s640/rm-structure.png&quot; width=&quot;640&quot; /&gt;&lt;/a&gt;&lt;/div&gt;
&lt;br /&gt;
&lt;br /&gt;
Explaining the structure of the application&lt;br /&gt;
&lt;ol style=&quot;text-align: left;&quot;&gt;
&lt;li&gt;app_delegate.rb    : Entry point of an iOS application&lt;/li&gt;
&lt;li&gt;Default-568h@2x.png  : Default Splash Screen for iPhone5&lt;/li&gt;
&lt;li&gt;main_spec.rb    sd: Main spec file&lt;/li&gt;
&lt;li&gt;Rakefile     : Application configuration&lt;/li&gt;
&lt;/ol&gt;
&lt;br /&gt;
Running the application on the Simulator&lt;br /&gt;
&lt;blockquote class=&quot;tr_bq&quot;&gt;
&lt;span style=&quot;background-color: #cccccc;&quot;&gt;&lt;b&gt;&amp;nbsp;rake&amp;nbsp; &lt;/b&gt;&lt;/span&gt;&lt;/blockquote&gt;
&lt;div class=&quot;separator&quot; style=&quot;clear: both; text-align: center;&quot;&gt;
&lt;a href=&quot;https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEhiik4Ypifcoao8zDiP0DM1OGdRjxuyGWtsKzVXZO3mWyfSnxcZE_hXJXPQj3EAgOSJrN0kMrHdUxvIpuwlCm6Brrd92_Y8by63ezGtM99HUtkVAdHMN_7R9U4Qy8l-6LvzinSEMkhi3I9c/s1600/rm-simulator.png&quot; imageanchor=&quot;1&quot; style=&quot;clear: left; float: left; margin-bottom: 1em; margin-right: 1em;&quot;&gt;&lt;img border=&quot;0&quot; height=&quot;196&quot; src=&quot;https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEhiik4Ypifcoao8zDiP0DM1OGdRjxuyGWtsKzVXZO3mWyfSnxcZE_hXJXPQj3EAgOSJrN0kMrHdUxvIpuwlCm6Brrd92_Y8by63ezGtM99HUtkVAdHMN_7R9U4Qy8l-6LvzinSEMkhi3I9c/s640/rm-simulator.png&quot; width=&quot;640&quot; /&gt;&lt;/a&gt;&lt;/div&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;blockquote class=&quot;tr_bq&quot;&gt;
&lt;h3 style=&quot;text-align: left;&quot;&gt;
&lt;span style=&quot;font-size: small;&quot;&gt;&lt;span style=&quot;font-family: &amp;quot;Trebuchet MS&amp;quot;,sans-serif;&quot;&gt;&lt;span style=&quot;font-weight: normal;&quot;&gt;So this is the first very basic application which we have put up and running on a simulator.&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;/h3&gt;
&lt;h3 style=&quot;text-align: left;&quot;&gt;
&lt;span style=&quot;font-size: small;&quot;&gt;&lt;span style=&quot;font-family: &amp;quot;Trebuchet MS&amp;quot;,sans-serif;&quot;&gt;&lt;span style=&quot;font-weight: normal;&quot;&gt;I will be moving step by step from the basics of using Ruby alongwith Cocoa and creating a Demo application throught it.&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;/h3&gt;
&lt;/blockquote&gt;
&lt;/div&gt;
</content><link rel='replies' type='application/atom+xml' href='http://rorashish.blogspot.com/feeds/1632630821592939276/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://rorashish.blogspot.com/2013/04/starting-with-rubymotion.html#comment-form' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/2936127337406425108/posts/default/1632630821592939276'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/2936127337406425108/posts/default/1632630821592939276'/><link rel='alternate' type='text/html' href='http://rorashish.blogspot.com/2013/04/starting-with-rubymotion.html' title='Starting With Rubymotion'/><author><name>Anonymous</name><uri>http://www.blogger.com/profile/14643110071701140642</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='16' height='16' src='https://img1.blogblog.com/img/b16-rounded.gif'/></author><media:thumbnail xmlns:media="http://search.yahoo.com/mrss/" url="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEifBIrl-WvHfMIcav9GNby975B0W7b2pAgUMbcSYx9pbyOv3-ZjP5GWsii0A1h_F4lfpnTQwBBE4BF_Q1SAyNegIN6KsU0l8Kc-fGg8ItuuW1dh8WH98THuPMcpviRo_o0yAoqIHPyko0Nd/s72-c/rm-update.png" height="72" width="72"/><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-2936127337406425108.post-8762093270904573906</id><published>2013-03-29T23:49:00.001+05:30</published><updated>2013-03-29T23:50:14.182+05:30</updated><category scheme="http://www.blogger.com/atom/ns#" term="rubymotion"/><title type='text'> TCS RSS Feed Reader 123</title><content type='html'>&lt;div dir=&quot;ltr&quot; style=&quot;text-align: left;&quot; trbidi=&quot;on&quot;&gt;
&lt;br /&gt;&lt;a href=&quot;https://github.com/upadhyay-ashish/TCSRssReader&quot;&gt;TCS RSS Feed&lt;/a&gt;&lt;br /&gt;
This is an iOS application build using &lt;br /&gt;
&lt;ul&gt;
&lt;li&gt;&lt;a href=&quot;http://rubymotion.com/&quot;&gt;Rubymotion&lt;/a&gt;&lt;/li&gt;
&lt;li&gt;&lt;a href=&quot;http://gembundler.com/&quot;&gt;Bundler&lt;/a&gt;&lt;/li&gt;
&lt;li&gt;&lt;a href=&quot;http://cocoapods.org/&quot;&gt;CocoaPods&lt;/a&gt;&lt;/li&gt;
&lt;li&gt;&lt;a href=&quot;https://github.com/siuying/NanoStoreInMotion&quot;&gt;NanoStoreInMotion&lt;/a&gt;&lt;/li&gt;
&lt;li&gt;&lt;a href=&quot;https://github.com/upadhyay-ashish/upadhyay-ashish.github.com/blob/master/_posts/www.pixate.com&quot;&gt;Pixate iOS Styling Framework&lt;/a&gt;&lt;/li&gt;
&lt;/ul&gt;
&lt;h3&gt;
&lt;a class=&quot;anchor&quot; href=&quot;https://github.com/upadhyay-ashish/upadhyay-ashish.github.com/blob/master/_posts/2013-03-23-Rubymotion.markdown#running-on-simulatordevice&quot; name=&quot;running-on-simulatordevice&quot;&gt;&lt;/a&gt;Running on Simulator/Device&lt;/h3&gt;
You will need Rubymotion installed on your Mac.&lt;br /&gt;
&lt;ol&gt;
&lt;li&gt;Clone repo &lt;code&gt; git clone &lt;a href=&quot;mailto:git@github.com&quot;&gt;git@github.com&lt;/a&gt;:upadhyay-ashish/TCSRssReader.git&lt;/code&gt;
&lt;/li&gt;
&lt;li&gt;Bundle gems &lt;code&gt; bundle install &lt;/code&gt;
&lt;/li&gt;
&lt;li&gt;Setup cocoapods &lt;code&gt; pod setup &lt;/code&gt;
&lt;/li&gt;
&lt;li&gt;Setup Developer license reference in the Rakefile &lt;/li&gt;
&lt;li&gt;To run on simulator &lt;code&gt; rake &lt;/code&gt; else to run on a Device &lt;code&gt; rake device &lt;/code&gt;
&lt;/li&gt;
&lt;li&gt;To create a distribution IPA &lt;code&gt; rake archive:distribution &lt;/code&gt;
&lt;/li&gt;
&lt;/ol&gt;
&lt;/div&gt;
</content><link rel='replies' type='application/atom+xml' href='http://rorashish.blogspot.com/feeds/8762093270904573906/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://rorashish.blogspot.com/2013/03/tcs-rss-feed-reader-123-tcs-rss-feed.html#comment-form' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/2936127337406425108/posts/default/8762093270904573906'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/2936127337406425108/posts/default/8762093270904573906'/><link rel='alternate' type='text/html' href='http://rorashish.blogspot.com/2013/03/tcs-rss-feed-reader-123-tcs-rss-feed.html' title=' TCS RSS Feed Reader 123'/><author><name>Anonymous</name><uri>http://www.blogger.com/profile/14643110071701140642</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='16' height='16' src='https://img1.blogblog.com/img/b16-rounded.gif'/></author><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-2936127337406425108.post-7174241690089672756</id><published>2013-02-25T17:16:00.002+05:30</published><updated>2013-02-25T17:19:27.138+05:30</updated><category scheme="http://www.blogger.com/atom/ns#" term="merge master"/><category scheme="http://www.blogger.com/atom/ns#" term="rename a branch git. git branch"/><title type='text'>Replacing master with a branch GIT</title><content type='html'>&lt;div dir=&quot;ltr&quot; style=&quot;text-align: left;&quot; trbidi=&quot;on&quot;&gt;
&lt;br /&gt;
&lt;br /&gt;
This will help us to overwrite the master branch with a new branch incase the new branch is in a better state than the master&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;blockquote class=&quot;tr_bq&quot;&gt;
&lt;ul style=&quot;text-align: left;&quot;&gt;
&lt;li&gt;git checkout seotweaks &lt;/li&gt;
&lt;li&gt;git merge -s ours master &lt;/li&gt;
&lt;li&gt;git checkout master &lt;/li&gt;
&lt;li&gt;git merge seotweaks&lt;/li&gt;
&lt;/ul&gt;
&lt;/blockquote&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
Thanks&lt;/div&gt;
</content><link rel='replies' type='application/atom+xml' href='http://rorashish.blogspot.com/feeds/7174241690089672756/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://rorashish.blogspot.com/2013/02/replacing-master-with-branch-git.html#comment-form' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/2936127337406425108/posts/default/7174241690089672756'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/2936127337406425108/posts/default/7174241690089672756'/><link rel='alternate' type='text/html' href='http://rorashish.blogspot.com/2013/02/replacing-master-with-branch-git.html' title='Replacing master with a branch GIT'/><author><name>Anonymous</name><uri>http://www.blogger.com/profile/14643110071701140642</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='16' height='16' src='https://img1.blogblog.com/img/b16-rounded.gif'/></author><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-2936127337406425108.post-2572591145517431225</id><published>2013-01-08T20:57:00.003+05:30</published><updated>2013-01-08T21:02:14.934+05:30</updated><category scheme="http://www.blogger.com/atom/ns#" term="jdbc mac"/><category scheme="http://www.blogger.com/atom/ns#" term="jdbc ruby"/><title type='text'>Using Oracle JDBC with JRuby on Mac OSx</title><content type='html'>&lt;div dir=&quot;ltr&quot; style=&quot;text-align: left;&quot; trbidi=&quot;on&quot;&gt;
&lt;a href=&quot;http://www.blogger.com/blogger.g?blogID=2936127337406425108&quot; imageanchor=&quot;1&quot; style=&quot;clear: left; float: left; margin-bottom: 1em; margin-right: 1em;&quot;&gt;&lt;/a&gt;&lt;a href=&quot;http://www.blogger.com/blogger.g?blogID=2936127337406425108&quot; imageanchor=&quot;1&quot; style=&quot;clear: left; float: left; margin-bottom: 1em; margin-right: 1em;&quot;&gt;&lt;/a&gt;&lt;span style=&quot;font-family: &amp;quot;Trebuchet MS&amp;quot;,sans-serif;&quot;&gt;Please follow the below steps to create a jruby library to connect to any oracle database on Mac OS x using Java ODBC drivers.&lt;/span&gt;&lt;br /&gt;
&lt;span style=&quot;font-family: &amp;quot;Trebuchet MS&amp;quot;,sans-serif;&quot;&gt;&lt;br /&gt;&lt;/span&gt;
&lt;span style=&quot;font-family: &amp;quot;Trebuchet MS&amp;quot;,sans-serif;&quot;&gt;&lt;br /&gt;&lt;/span&gt;
&lt;span style=&quot;font-family: &amp;quot;Trebuchet MS&amp;quot;,sans-serif;&quot;&gt;&lt;b&gt;STEP 1: &lt;/b&gt;Create the Library folder and the Ruby file. eg Sample.rb&lt;/span&gt;&lt;br /&gt;
&lt;span style=&quot;font-family: &amp;quot;Trebuchet MS&amp;quot;,sans-serif;&quot;&gt;&lt;b&gt;Step 2 : &lt;/b&gt;Add Gemfile to enable using jruby to connect to the database&lt;/span&gt;&lt;br /&gt;
&lt;span style=&quot;font-family: &amp;quot;Trebuchet MS&amp;quot;,sans-serif;&quot;&gt;&lt;br /&gt;&lt;/span&gt;
&lt;span style=&quot;font-family: &amp;quot;Trebuchet MS&amp;quot;,sans-serif;&quot;&gt;&lt;b&gt;Step 3 :&amp;nbsp;&lt;/b&gt; add the following gems to the Gemfile&lt;/span&gt;&lt;br /&gt;
&lt;blockquote class=&quot;tr_bq&quot;&gt;
&lt;a href=&quot;http://www.blogger.com/blogger.g?blogID=2936127337406425108&quot; imageanchor=&quot;1&quot; style=&quot;clear: right; float: right; margin-bottom: 1em; margin-left: 1em;&quot;&gt;&lt;/a&gt;&lt;a href=&quot;http://www.blogger.com/blogger.g?blogID=2936127337406425108&quot; imageanchor=&quot;1&quot; style=&quot;clear: right; float: right; margin-bottom: 1em; margin-left: 1em;&quot;&gt;&lt;/a&gt;&lt;span style=&quot;font-family: &amp;quot;Trebuchet MS&amp;quot;,sans-serif;&quot;&gt;gem &#39;activerecord&#39;&lt;/span&gt;&lt;br /&gt;
&lt;span style=&quot;font-family: &amp;quot;Trebuchet MS&amp;quot;,sans-serif;&quot;&gt;gem &quot;activerecord-jdbc-adapter&quot;&lt;/span&gt;&lt;/blockquote&gt;
&lt;span style=&quot;font-family: &amp;quot;Trebuchet MS&amp;quot;,sans-serif;&quot;&gt;&lt;br /&gt;&lt;/span&gt;
&lt;span style=&quot;font-family: &amp;quot;Trebuchet MS&amp;quot;,sans-serif;&quot;&gt;&lt;b&gt;Step 4 : &lt;/b&gt;In the ruby file Sample.rb here please use the following lines and then write appropriate&amp;nbsp; code to access the data.&lt;/span&gt;&lt;br /&gt;
&lt;span style=&quot;font-family: &amp;quot;Trebuchet MS&amp;quot;,sans-serif;&quot;&gt;&lt;br /&gt;&lt;/span&gt;
&lt;span style=&quot;font-family: &amp;quot;Trebuchet MS&amp;quot;,sans-serif;&quot;&gt;class Person &amp;lt; ActiveRecord::Base&lt;/span&gt;&lt;br /&gt;
&lt;span style=&quot;font-family: &amp;quot;Trebuchet MS&amp;quot;,sans-serif;&quot;&gt;&lt;br /&gt;&lt;/span&gt;
&lt;span style=&quot;font-family: &amp;quot;Trebuchet MS&amp;quot;,sans-serif;&quot;&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; establish_connection(&lt;/span&gt;&lt;br /&gt;
&lt;span style=&quot;font-family: &amp;quot;Trebuchet MS&amp;quot;,sans-serif;&quot;&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; :adapter&amp;nbsp; =&amp;gt; &#39;jdbc&#39;,&lt;/span&gt;&lt;br /&gt;
&lt;span style=&quot;font-family: &amp;quot;Trebuchet MS&amp;quot;,sans-serif;&quot;&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; :driver&amp;nbsp;&amp;nbsp; =&amp;gt; &#39;oracle.jdbc.driver.OracleDriver&#39;,&lt;/span&gt;&lt;br /&gt;
&lt;span style=&quot;font-family: &amp;quot;Trebuchet MS&amp;quot;,sans-serif;&quot;&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; :url&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; =&amp;gt; &#39;jdbc:oracle:thin:@server:port/sid&#39;,&lt;/span&gt;&lt;br /&gt;
&lt;span style=&quot;font-family: &amp;quot;Trebuchet MS&amp;quot;,sans-serif;&quot;&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; :username =&amp;gt; &#39;ors&#39;,&lt;/span&gt;&lt;br /&gt;
&lt;span style=&quot;font-family: &amp;quot;Trebuchet MS&amp;quot;,sans-serif;&quot;&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; :password =&amp;gt; &#39;ors&#39;&lt;/span&gt;&lt;br /&gt;
&lt;span style=&quot;font-family: &amp;quot;Trebuchet MS&amp;quot;,sans-serif;&quot;&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; )&lt;/span&gt;&lt;br /&gt;
&lt;span style=&quot;font-family: &amp;quot;Trebuchet MS&amp;quot;,sans-serif;&quot;&gt;&lt;br /&gt;&lt;/span&gt;
&lt;span style=&quot;font-family: &amp;quot;Trebuchet MS&amp;quot;,sans-serif;&quot;&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; self.table_name = :table_name_here&lt;/span&gt;&lt;br /&gt;
&lt;span style=&quot;font-family: &amp;quot;Trebuchet MS&amp;quot;,sans-serif;&quot;&gt;&lt;br /&gt;&lt;/span&gt;
&lt;span style=&quot;font-family: &amp;quot;Trebuchet MS&amp;quot;,sans-serif;&quot;&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; def self.all&lt;/span&gt;&lt;br /&gt;
&lt;span style=&quot;font-family: &amp;quot;Trebuchet MS&amp;quot;,sans-serif;&quot;&gt;&lt;br /&gt;&lt;/span&gt;
&lt;span style=&quot;font-family: &amp;quot;Trebuchet MS&amp;quot;,sans-serif;&quot;&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; connection.select_all &amp;lt;&amp;lt;-SQL&lt;/span&gt;&lt;br /&gt;
&lt;span style=&quot;font-family: &amp;quot;Trebuchet MS&amp;quot;,sans-serif;&quot;&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; &amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; select * from table_name_here&lt;/span&gt;&lt;br /&gt;
&lt;span style=&quot;font-family: &amp;quot;Trebuchet MS&amp;quot;,sans-serif;&quot;&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; SQL&lt;/span&gt;&lt;br /&gt;
&lt;span style=&quot;font-family: &amp;quot;Trebuchet MS&amp;quot;,sans-serif;&quot;&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; end&lt;/span&gt;&lt;br /&gt;
&lt;span style=&quot;font-family: &amp;quot;Trebuchet MS&amp;quot;,sans-serif;&quot;&gt;&amp;nbsp;end&lt;/span&gt;&lt;br /&gt;
&lt;span style=&quot;font-family: &amp;quot;Trebuchet MS&amp;quot;,sans-serif;&quot;&gt;&lt;br /&gt;&lt;/span&gt;
&lt;span style=&quot;font-family: &amp;quot;Trebuchet MS&amp;quot;,sans-serif;&quot;&gt;&lt;b&gt;Step 5 : &lt;/b&gt;Go to terminal , run&lt;/span&gt;&lt;br /&gt;
&lt;span style=&quot;font-family: &amp;quot;Trebuchet MS&amp;quot;,sans-serif;&quot;&gt;&lt;br /&gt;&lt;/span&gt;
&lt;br /&gt;
&lt;blockquote class=&quot;tr_bq&quot;&gt;
&lt;span style=&quot;font-family: &amp;quot;Trebuchet MS&amp;quot;,sans-serif;&quot;&gt;bundle install&amp;nbsp;&lt;/span&gt;&lt;/blockquote&gt;
&lt;blockquote&gt;
&lt;span style=&quot;font-family: &amp;quot;Trebuchet MS&amp;quot;,sans-serif;&quot;&gt;jruby Sample.rb&lt;/span&gt;&lt;/blockquote&gt;
&lt;span style=&quot;font-family: &amp;quot;Trebuchet MS&amp;quot;,sans-serif;&quot;&gt;&lt;br /&gt;&lt;/span&gt;
&lt;span style=&quot;font-family: &amp;quot;Trebuchet MS&amp;quot;,sans-serif;&quot;&gt;&lt;b&gt;Step 6 : &lt;/b&gt;If there is a driver not found error please download the driver from oracle site&amp;nbsp;&lt;a href=&quot;https://edelivery.oracle.com/akam/otn/mac/instantclient/10204/instantclient-jdbc-10.2.0.4.0-macosx-x86.zip&quot; target=&quot;_blank&quot;&gt;here&amp;nbsp;&lt;/a&gt;&lt;/span&gt;&lt;br /&gt;
&lt;span style=&quot;font-family: &amp;quot;Trebuchet MS&amp;quot;,sans-serif;&quot;&gt;and place it in /Library/Java/Extensions/ on your mac.&lt;/span&gt;&lt;br /&gt;
&lt;span style=&quot;font-family: &amp;quot;Trebuchet MS&amp;quot;,sans-serif;&quot;&gt;&lt;br /&gt;&lt;/span&gt;
&lt;span style=&quot;font-family: &amp;quot;Trebuchet MS&amp;quot;,sans-serif;&quot;&gt;&lt;b&gt;Have Fun !&lt;/b&gt;&lt;/span&gt;&lt;br /&gt;
&lt;span style=&quot;font-family: &amp;quot;Trebuchet MS&amp;quot;,sans-serif;&quot;&gt;&lt;br /&gt;&lt;/span&gt;
&lt;span style=&quot;font-family: &amp;quot;Trebuchet MS&amp;quot;,sans-serif;&quot;&gt;&lt;br /&gt;&lt;/span&gt;
&lt;span style=&quot;font-family: &amp;quot;Trebuchet MS&amp;quot;,sans-serif;&quot;&gt;&lt;br /&gt;&lt;/span&gt;
&lt;span style=&quot;font-family: &amp;quot;Trebuchet MS&amp;quot;,sans-serif;&quot;&gt;&lt;br /&gt;&lt;/span&gt;
&lt;span style=&quot;font-family: &amp;quot;Trebuchet MS&amp;quot;,sans-serif;&quot;&gt;&lt;br /&gt;&lt;/span&gt;
&lt;span style=&quot;font-family: &amp;quot;Trebuchet MS&amp;quot;,sans-serif;&quot;&gt;&lt;br /&gt;&lt;/span&gt;
&lt;span style=&quot;font-family: &amp;quot;Trebuchet MS&amp;quot;,sans-serif;&quot;&gt;&lt;br /&gt;&lt;/span&gt;
&lt;span style=&quot;font-family: &amp;quot;Trebuchet MS&amp;quot;,sans-serif;&quot;&gt;&lt;br /&gt;&lt;/span&gt;
&lt;span style=&quot;font-family: &amp;quot;Trebuchet MS&amp;quot;,sans-serif;&quot;&gt;&lt;br /&gt;&lt;/span&gt;
&lt;span style=&quot;font-family: &amp;quot;Trebuchet MS&amp;quot;,sans-serif;&quot;&gt;&lt;br /&gt;&lt;/span&gt;&lt;/div&gt;
</content><link rel='replies' type='application/atom+xml' href='http://rorashish.blogspot.com/feeds/2572591145517431225/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://rorashish.blogspot.com/2013/01/using-oracle-jdbc-with-jruby-on-mac-osx.html#comment-form' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/2936127337406425108/posts/default/2572591145517431225'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/2936127337406425108/posts/default/2572591145517431225'/><link rel='alternate' type='text/html' href='http://rorashish.blogspot.com/2013/01/using-oracle-jdbc-with-jruby-on-mac-osx.html' title='Using Oracle JDBC with JRuby on Mac OSx'/><author><name>Anonymous</name><uri>http://www.blogger.com/profile/14643110071701140642</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='16' height='16' src='https://img1.blogblog.com/img/b16-rounded.gif'/></author><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-2936127337406425108.post-772845902236581222</id><published>2012-12-08T13:38:00.002+05:30</published><updated>2012-12-08T13:55:52.034+05:30</updated><category scheme="http://www.blogger.com/atom/ns#" term="accepts_nested_attributes_for"/><category scheme="http://www.blogger.com/atom/ns#" term="bootstrap"/><category scheme="http://www.blogger.com/atom/ns#" term="dropbox-rails"/><category scheme="http://www.blogger.com/atom/ns#" term="file-storage-rails"/><category scheme="http://www.blogger.com/atom/ns#" term="multi-model-forms"/><category scheme="http://www.blogger.com/atom/ns#" term="nested-forms"/><category scheme="http://www.blogger.com/atom/ns#" term="nested_form"/><category scheme="http://www.blogger.com/atom/ns#" term="paperclip"/><category scheme="http://www.blogger.com/atom/ns#" term="paperclip-dropbox"/><category scheme="http://www.blogger.com/atom/ns#" term="photo-upload"/><category scheme="http://www.blogger.com/atom/ns#" term="rails-nested-forms"/><category scheme="http://www.blogger.com/atom/ns#" term="rails-paperclip"/><title type='text'>Using nested_forms gem + dropbox-paperclip + twitter-bootstrap</title><content type='html'>&lt;div dir=&quot;ltr&quot; style=&quot;text-align: left;&quot; trbidi=&quot;on&quot;&gt;
&lt;div class=&quot;tr_bq&quot;&gt;
&lt;/div&gt;
&lt;br /&gt;
&lt;span style=&quot;font-family: Verdana,sans-serif;&quot;&gt;This is a tutorial about using nested_forms gem with dropbox-paperclip plugin on Heroku to create a multiple photo upload albums interface with twitter bootstrap&amp;nbsp;&lt;/span&gt;&lt;br /&gt;
&lt;br /&gt;
&lt;span style=&quot;font-family: Verdana,sans-serif;&quot;&gt;Demo application :&lt;/span&gt;&lt;br /&gt;
&lt;ul style=&quot;text-align: left;&quot;&gt;
&lt;li&gt;&lt;span style=&quot;font-family: Verdana,sans-serif;&quot;&gt;&amp;nbsp;&lt;/span&gt;&lt;span style=&quot;font-family: Verdana,sans-serif;&quot;&gt;&lt;a href=&quot;http://ashish-albums.herokuapp.com/&quot; target=&quot;_blank&quot;&gt;http://ashish-albums.herokuapp.com/&lt;/a&gt;&amp;nbsp;&lt;/span&gt;&lt;/li&gt;
&lt;/ul&gt;
&lt;span style=&quot;font-family: Verdana,sans-serif;&quot;&gt;Gems used : &amp;nbsp; &lt;/span&gt;&lt;br /&gt;
&lt;ul style=&quot;text-align: left;&quot;&gt;
&lt;li&gt;&lt;span style=&quot;font-family: Verdana,sans-serif;&quot;&gt;&lt;a href=&quot;https://github.com/ryanb/nested_form&quot; target=&quot;_blank&quot;&gt;https://github.com/ryanb/nested_form&lt;/a&gt;&lt;/span&gt;&lt;/li&gt;
&lt;li&gt;&lt;span style=&quot;font-family: Verdana,sans-serif;&quot;&gt;&lt;a href=&quot;https://github.com/janko-m/paperclip-dropbox&quot; target=&quot;_blank&quot;&gt;https://github.com/janko-m/paperclip-dropbox&lt;/a&gt;&lt;/span&gt;&lt;/li&gt;
&lt;li&gt;&lt;span style=&quot;font-family: Verdana,sans-serif;&quot;&gt;&lt;a href=&quot;https://github.com/seyhunak/twitter-bootstrap-rails&quot; target=&quot;_blank&quot;&gt;https://github.com/seyhunak/twitter-bootstrap-rails&lt;/a&gt;&amp;nbsp;&lt;/span&gt;&lt;/li&gt;
&lt;/ul&gt;
&lt;span style=&quot;font-family: Verdana,sans-serif;&quot;&gt;&lt;br /&gt;&lt;/span&gt;
&lt;span style=&quot;font-family: Verdana,sans-serif;&quot;&gt;&lt;br /&gt;&lt;/span&gt;
&lt;br /&gt;
&lt;a name=&#39;more&#39;&gt;&lt;/a&gt;&lt;span style=&quot;font-family: Verdana,sans-serif;&quot;&gt;&lt;b&gt;Step 1 : Create a new rails app and add the gems to Gemfile.&amp;nbsp;&lt;/b&gt;&lt;/span&gt;&lt;br /&gt;
&lt;span style=&quot;font-family: Verdana,sans-serif;&quot;&gt;&lt;/span&gt;

&lt;br /&gt;
&lt;ul style=&quot;text-align: left;&quot;&gt;
&lt;li&gt;&lt;span style=&quot;font-family: Verdana,sans-serif;&quot;&gt;&lt;span style=&quot;background-color: #cccccc;&quot;&gt;paperclip&lt;/span&gt;&lt;/span&gt;&lt;/li&gt;
&lt;span style=&quot;font-family: Verdana,sans-serif;&quot;&gt;&lt;span style=&quot;background-color: #cccccc;&quot;&gt;
&lt;/span&gt;&lt;/span&gt;
&lt;li&gt;&lt;span style=&quot;font-family: Verdana,sans-serif;&quot;&gt;&lt;span style=&quot;background-color: #cccccc;&quot;&gt;paperclip-dropbox&lt;/span&gt;&lt;/span&gt;&lt;/li&gt;
&lt;span style=&quot;font-family: Verdana,sans-serif;&quot;&gt;&lt;span style=&quot;background-color: #cccccc;&quot;&gt;
&lt;/span&gt;&lt;/span&gt;
&lt;li&gt;&lt;span style=&quot;font-family: Verdana,sans-serif;&quot;&gt;&lt;span style=&quot;background-color: #999999;&quot;&gt;&lt;span style=&quot;background-color: #cccccc;&quot;&gt;nested_form&amp;nbsp; &lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;/li&gt;
&lt;/ul&gt;
&lt;span style=&quot;font-family: Verdana,sans-serif;&quot;&gt;&lt;b&gt;Step 2 : Create 3 models&lt;/b&gt;&lt;/span&gt;&lt;br /&gt;
&lt;span style=&quot;font-family: Verdana,sans-serif;&quot;&gt;&lt;/span&gt;

&lt;br /&gt;
&lt;ul style=&quot;text-align: left;&quot;&gt;
&lt;li&gt;&lt;span style=&quot;font-family: Verdana,sans-serif;&quot;&gt;&lt;span style=&quot;background-color: #cccccc;&quot;&gt;&amp;nbsp;rails g model User name:string&lt;/span&gt;&lt;/span&gt;&lt;/li&gt;
&lt;span style=&quot;font-family: Verdana,sans-serif;&quot;&gt;&lt;span style=&quot;background-color: #cccccc;&quot;&gt;
&lt;/span&gt;&lt;/span&gt;
&lt;li&gt;&lt;span style=&quot;font-family: Verdana,sans-serif;&quot;&gt;&lt;span style=&quot;background-color: #cccccc;&quot;&gt;&amp;nbsp;rails g model Album name:string user_id:integer&lt;/span&gt;&lt;/span&gt;&lt;/li&gt;
&lt;span style=&quot;font-family: Verdana,sans-serif;&quot;&gt;&lt;span style=&quot;background-color: #cccccc;&quot;&gt;
&lt;/span&gt;&lt;/span&gt;
&lt;li&gt;&lt;span style=&quot;font-family: Verdana,sans-serif;&quot;&gt;&lt;span style=&quot;background-color: #cccccc;&quot;&gt;&amp;nbsp;rails g model Photo tags_name:string album_id:integer&lt;/span&gt;&lt;/span&gt;&lt;/li&gt;
&lt;/ul&gt;
&lt;span style=&quot;font-family: Verdana,sans-serif;&quot;&gt;&lt;b&gt;Step 3 : Adding relationships among models&lt;/b&gt;&lt;/span&gt;&lt;br /&gt;
&lt;span style=&quot;font-family: Verdana,sans-serif;&quot;&gt;&lt;/span&gt;

&lt;br /&gt;
&lt;ul style=&quot;text-align: left;&quot;&gt;
&lt;li&gt;&lt;span style=&quot;font-family: Verdana,sans-serif;&quot;&gt;&lt;span style=&quot;background-color: #cccccc;&quot;&gt;&lt;b&gt;&lt;span style=&quot;background-color: #eeeeee;&quot;&gt;in app/models/user.rb :&amp;nbsp;&lt;/span&gt;&lt;/b&gt; &lt;/span&gt;&lt;/span&gt;&lt;/li&gt;
&lt;/ul&gt;
&lt;blockquote class=&quot;tr_bq&quot;&gt;
&lt;blockquote class=&quot;tr_bq&quot;&gt;
&lt;span style=&quot;font-family: Verdana,sans-serif;&quot;&gt;&lt;span style=&quot;background-color: #cccccc;&quot;&gt;has_many :albums, :dependent =&amp;gt; :destroy&lt;/span&gt;&lt;/span&gt;&lt;br /&gt;
&lt;span style=&quot;font-family: Verdana,sans-serif;&quot;&gt;&lt;span style=&quot;background-color: #cccccc;&quot;&gt;accepts_nested_attributes_for :albums&lt;/span&gt;&lt;/span&gt;&lt;br /&gt;
&lt;span style=&quot;font-family: Verdana,sans-serif;&quot;&gt;&lt;span style=&quot;background-color: #cccccc;&quot;&gt;attr_accessible :name, :albums_attributes&lt;/span&gt;&lt;/span&gt;&lt;br /&gt;
&lt;span style=&quot;font-family: Verdana,sans-serif;&quot;&gt;&lt;span style=&quot;background-color: #cccccc;&quot;&gt;validates_presence_of :nam&lt;/span&gt;e &lt;/span&gt;&lt;/blockquote&gt;
&lt;/blockquote&gt;
&lt;span style=&quot;font-family: Verdana,sans-serif;&quot;&gt;&lt;/span&gt;

&lt;br /&gt;
&lt;ul style=&quot;text-align: left;&quot;&gt;
&lt;li&gt;&lt;span style=&quot;font-family: Verdana,sans-serif;&quot;&gt;&lt;span style=&quot;background-color: #cccccc;&quot;&gt;&lt;b&gt;&lt;span style=&quot;background-color: #eeeeee;&quot;&gt;&amp;nbsp;in app/models/album.rb&lt;/span&gt;&lt;/b&gt; &lt;/span&gt;&lt;/span&gt;&lt;/li&gt;
&lt;/ul&gt;
&lt;blockquote class=&quot;tr_bq&quot;&gt;
&lt;blockquote class=&quot;tr_bq&quot;&gt;
&lt;span style=&quot;font-family: Verdana,sans-serif;&quot;&gt;&lt;span style=&quot;background-color: #cccccc;&quot;&gt;belongs_to :user &lt;br /&gt;has_many :photos, :dependent =&amp;gt; :destroy&lt;br /&gt;      accepts_nested_attributes_for :photos, :allow_destroy =&amp;gt; true&lt;br /&gt;      attr_accessible :name, :photos_attributes&lt;br /&gt;      validates_presence_of :name&lt;/span&gt;&lt;/span&gt;&lt;/blockquote&gt;
&lt;/blockquote&gt;
&lt;span style=&quot;font-family: Verdana,sans-serif;&quot;&gt;&lt;/span&gt;

&lt;br /&gt;
&lt;ul style=&quot;text-align: left;&quot;&gt;
&lt;li&gt;&lt;span style=&quot;font-family: Verdana,sans-serif;&quot;&gt;&lt;b&gt;&lt;span style=&quot;background-color: #eeeeee;&quot;&gt;in app/models/photo.rb &lt;/span&gt;&lt;/b&gt;&lt;/span&gt;&lt;/li&gt;
&lt;/ul&gt;
&lt;blockquote class=&quot;tr_bq&quot;&gt;
&lt;blockquote class=&quot;tr_bq&quot;&gt;
&lt;span style=&quot;font-family: Verdana,sans-serif;&quot;&gt;&lt;span style=&quot;background-color: #cccccc;&quot;&gt;belongs_to :album&lt;br /&gt;      attr_accessible :avatar, :tags_name&lt;br /&gt;      has_attached_file :avatar,&lt;br /&gt;        :storage =&amp;gt; :dropbox,&lt;br /&gt;        :dropbox_credentials =&amp;gt; &quot;#{Rails.root}/config/dropbox.yml&quot;,&lt;br /&gt;        :styles =&amp;gt; { :thumb =&amp;gt; &quot;100x100&quot; },&lt;br /&gt;        :dropbox_options =&amp;gt; {&lt;br /&gt;          :path =&amp;gt; proc { |style| &quot;#{style}/#{id}_#{avatar.original_filename}&quot;}&lt;br /&gt;        }&lt;br /&gt;      validates_presence_of :avatar &lt;/span&gt;&lt;/span&gt;&lt;/blockquote&gt;
&lt;/blockquote&gt;
&lt;span style=&quot;font-family: Verdana,sans-serif;&quot;&gt;&lt;br /&gt;&lt;/span&gt;
&lt;span style=&quot;font-family: Verdana,sans-serif;&quot;&gt;&lt;br /&gt;&lt;/span&gt;
&lt;span style=&quot;font-family: Verdana,sans-serif;&quot;&gt;&lt;b&gt;Step 4 : Adding a controller and a few actions&amp;nbsp;&lt;/b&gt;&lt;/span&gt;&lt;br /&gt;
&lt;span style=&quot;font-family: Verdana,sans-serif;&quot;&gt;&lt;/span&gt;

&lt;br /&gt;
&lt;ul style=&quot;text-align: left;&quot;&gt;
&lt;li&gt;&lt;span style=&quot;font-family: Verdana,sans-serif;&quot;&gt;&lt;span style=&quot;background-color: #cccccc;&quot;&gt;rails g controller&amp;nbsp; Users &lt;/span&gt;&lt;/span&gt;&lt;/li&gt;
&lt;li&gt;&lt;span style=&quot;font-family: Verdana,sans-serif;&quot;&gt;&lt;span style=&quot;background-color: #cccccc;&quot;&gt;&lt;span style=&quot;color: red;&quot;&gt;add following code to the controller &lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;blockquote class=&quot;tr_bq&quot;&gt;
&lt;span style=&quot;font-family: Verdana,sans-serif;&quot;&gt;&lt;span style=&quot;background-color: #cccccc;&quot;&gt;def index&lt;br /&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; @users = User.all&lt;br /&gt;end&lt;br /&gt;&amp;nbsp;&lt;/span&gt;&lt;/span&gt;&lt;br /&gt;
&lt;span style=&quot;font-family: Verdana,sans-serif;&quot;&gt;&lt;span style=&quot;background-color: #cccccc;&quot;&gt;def new&lt;br /&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; @user = User.new&lt;br /&gt;end&lt;br /&gt;&amp;nbsp;&lt;/span&gt;&lt;/span&gt;&lt;br /&gt;
&lt;span style=&quot;font-family: Verdana,sans-serif;&quot;&gt;&lt;span style=&quot;background-color: #cccccc;&quot;&gt;def create&lt;br /&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; @user = User.new(params[:user])&lt;br /&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; if @user.save&lt;br /&gt;&amp;nbsp;&amp;nbsp; &amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; redirect_to root_url&lt;/span&gt;&lt;/span&gt;&lt;br /&gt;
&lt;span style=&quot;font-family: Verdana,sans-serif;&quot;&gt;&lt;span style=&quot;background-color: #cccccc;&quot;&gt;&amp;nbsp; &amp;nbsp; else&lt;br /&gt;&amp;nbsp;&amp;nbsp; &amp;nbsp;&amp;nbsp; &amp;nbsp; redirect_to root_url&lt;br /&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; end&lt;br /&gt;end&lt;br /&gt;&amp;nbsp;&lt;/span&gt;&lt;/span&gt;&lt;br /&gt;
&lt;span style=&quot;font-family: Verdana,sans-serif;&quot;&gt;&lt;span style=&quot;background-color: #cccccc;&quot;&gt;def show_albums&lt;br /&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; @albums = Album.find(params[:id])&lt;br /&gt;end&lt;br /&gt;&amp;nbsp;&lt;/span&gt;&lt;/span&gt;&lt;br /&gt;
&lt;span style=&quot;font-family: Verdana,sans-serif;&quot;&gt;&lt;span style=&quot;background-color: #cccccc;&quot;&gt;def destroy&lt;br /&gt;&amp;nbsp; @user = User.find(params[:id])&lt;br /&gt;&amp;nbsp; @user.destroy&amp;nbsp;&lt;/span&gt;&lt;/span&gt;&lt;br /&gt;
&lt;span style=&quot;font-family: Verdana,sans-serif;&quot;&gt;&lt;span style=&quot;background-color: #cccccc;&quot;&gt;&amp;nbsp;&amp;nbsp; redirect_to root_url&lt;br /&gt;end &lt;/span&gt;&lt;/span&gt;&lt;/blockquote&gt;
&lt;/li&gt;
&lt;/ul&gt;
&lt;span style=&quot;font-family: Verdana,sans-serif;&quot;&gt;&lt;br /&gt;&lt;/span&gt;
&lt;span style=&quot;font-family: Verdana,sans-serif;&quot;&gt;&lt;b&gt;Step 5 : Adding routes to routes.rb&lt;/b&gt;&lt;/span&gt;&lt;br /&gt;
&lt;blockquote class=&quot;tr_bq&quot;&gt;
&lt;span style=&quot;font-family: Verdana,sans-serif;&quot;&gt;&lt;span style=&quot;background-color: #cccccc;&quot;&gt;resources :users do&lt;br /&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; member do&lt;br /&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; get &#39;show_albums&#39;&lt;br /&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; end&lt;br /&gt;end&lt;/span&gt;&lt;/span&gt;&lt;br /&gt;
&lt;span style=&quot;font-family: Verdana,sans-serif;&quot;&gt;&lt;span style=&quot;background-color: #cccccc;&quot;&gt;root :to =&amp;gt; &#39;users#index&#39;&lt;/span&gt;&lt;/span&gt;&lt;/blockquote&gt;
&lt;span style=&quot;font-family: Verdana,sans-serif;&quot;&gt;&lt;br /&gt;&lt;/span&gt;
&lt;span style=&quot;font-family: Verdana,sans-serif;&quot;&gt;&lt;b&gt;Step 6 : Creating views for forms and data show&amp;nbsp;&lt;/b&gt;&lt;/span&gt;&lt;br /&gt;
&lt;blockquote class=&quot;tr_bq&quot;&gt;
&lt;ul style=&quot;text-align: left;&quot;&gt;
&lt;li&gt;&lt;span style=&quot;font-family: Verdana,sans-serif;&quot;&gt;&amp;nbsp;index.html.erb&lt;/span&gt;&lt;/li&gt;
&lt;li&gt;&lt;span style=&quot;font-family: Verdana,sans-serif;&quot;&gt;&amp;nbsp;new.html.erb&lt;/span&gt;&lt;/li&gt;
&lt;li&gt;&lt;span style=&quot;font-family: Verdana,sans-serif;&quot;&gt;&amp;nbsp;show_albums.html.erb&lt;/span&gt;&lt;/li&gt;
&lt;li&gt;&lt;span style=&quot;font-family: Verdana,sans-serif;&quot;&gt;&amp;nbsp;_album_fields.html.erb&lt;/span&gt;&lt;/li&gt;
&lt;li&gt;&lt;span style=&quot;font-family: Verdana,sans-serif;&quot;&gt;&amp;nbsp;_photo_fields.html.erb&lt;/span&gt;&lt;/li&gt;
&lt;/ul&gt;
&lt;/blockquote&gt;
&lt;span style=&quot;font-family: Verdana,sans-serif;&quot;&gt;&lt;br /&gt;&lt;/span&gt;
&lt;span style=&quot;font-family: Verdana,sans-serif;&quot;&gt;&lt;b&gt;Step 7 : Adding form html to views&amp;nbsp;&lt;/b&gt;&lt;/span&gt;&lt;br /&gt;
&lt;span style=&quot;font-family: Verdana,sans-serif;&quot;&gt;&amp;nbsp; &lt;/span&gt;&lt;br /&gt;
&lt;blockquote class=&quot;tr_bq&quot;&gt;
&lt;span style=&quot;font-family: Verdana,sans-serif;&quot;&gt;&lt;span style=&quot;color: red;&quot;&gt;&lt;b&gt;in index.html.erb :&lt;/b&gt;&lt;/span&gt;&lt;/span&gt;&lt;/blockquote&gt;
&lt;span style=&quot;font-family: Verdana,sans-serif;&quot;&gt;&lt;br /&gt;&lt;/span&gt;
&lt;br /&gt;
&lt;blockquote class=&quot;tr_bq&quot;&gt;
&lt;span style=&quot;font-family: Verdana,sans-serif;&quot;&gt;&lt;span style=&quot;background-color: #cccccc;&quot;&gt;&amp;lt;%= link_to &#39;New User&#39;, new_user_path , :class =&amp;gt; &#39;btn btn-medium btn-primary pull-right&#39;%&amp;gt;&lt;br /&gt;&amp;lt;table class=&quot;table table-striped&quot;&amp;gt;&lt;br /&gt;&amp;nbsp; &amp;lt;tr&amp;gt;&lt;br /&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; &amp;lt;th&amp;gt;Name&amp;lt;/th&amp;gt;&lt;br /&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; &amp;lt;th&amp;gt;Album Names&amp;lt;/th&amp;gt;&lt;br /&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; &amp;lt;!--th&amp;gt;Tags&amp;lt;/th--&amp;gt;&lt;br /&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; &amp;lt;th&amp;gt;Destroy&amp;lt;/th&amp;gt;&lt;br /&gt;&amp;nbsp; &amp;lt;/tr&amp;gt;&lt;br /&gt;&amp;lt;% @users.each do |user| %&amp;gt;&lt;br /&gt;&amp;nbsp; &amp;lt;tr&amp;gt;&lt;br /&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; &amp;lt;td&amp;gt;&amp;lt;%= user.name %&amp;gt;&amp;lt;/td&amp;gt;&lt;br /&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; &amp;lt;td&amp;gt;&lt;br /&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; &amp;lt;% (user_albums_link user).each do |album_link| %&amp;gt; &lt;br /&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; &amp;lt;%= album_link.html_safe %&amp;gt;&lt;br /&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; &amp;lt;% end %&amp;gt;&lt;br /&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; &amp;lt;% thumbnails = show_photo_thumbnails(user.albums) if user.albums %&amp;gt;&lt;br /&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; &amp;lt;% if thumbnails %&amp;gt;&lt;br /&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; &amp;lt;% thumbnails.each do |thumb| %&amp;gt;&lt;br /&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; &amp;lt;%= thumb.html_safe&amp;nbsp; %&amp;gt;&lt;br /&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; &amp;lt;% end %&amp;gt;&lt;br /&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; &amp;lt;% end %&amp;gt;&lt;br /&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; &amp;lt;/td&amp;gt;&lt;br /&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; &amp;lt;!--td&amp;gt;&lt;br /&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; &amp;lt;%#= tags user.albums %&amp;gt;&lt;br /&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; &amp;lt;/td--&amp;gt;&lt;br /&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; &amp;lt;td&amp;gt;&lt;br /&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; &amp;lt;%= link_to t(&#39;.destroy&#39;, :default =&amp;gt; t(&quot;helpers.links.destroy&quot;)),&lt;br /&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; user_path(user),&lt;br /&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; :method =&amp;gt; :delete,&lt;br /&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; :data =&amp;gt; { :confirm =&amp;gt; t(&#39;.confirm&#39;, :default =&amp;gt; t(&quot;helpers.links.confirm&quot;, :default =&amp;gt; &#39;Are you sure?&#39;)) },&lt;br /&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; :class =&amp;gt; &#39;btn btn-mini btn-danger&#39; %&amp;gt;&lt;br /&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; &amp;lt;/td&amp;gt;&lt;br /&gt;&amp;nbsp; &amp;lt;/tr&amp;gt;&lt;br /&gt;&amp;lt;% end %&amp;gt;&lt;br /&gt;&amp;lt;/table&amp;gt;&lt;br /&gt;&amp;lt;br /&amp;gt;&lt;/span&gt;&lt;/span&gt; &lt;/blockquote&gt;
&lt;blockquote class=&quot;tr_bq&quot;&gt;
&lt;span style=&quot;font-family: Verdana,sans-serif;&quot;&gt;&lt;span style=&quot;color: red;&quot;&gt;&lt;b&gt;in new.html.erb :&lt;/b&gt;&lt;/span&gt;&lt;/span&gt;&lt;/blockquote&gt;
&lt;blockquote class=&quot;tr_bq&quot;&gt;
&lt;span style=&quot;font-family: Verdana,sans-serif;&quot;&gt;&lt;span style=&quot;background-color: #cccccc;&quot;&gt;&amp;lt;%= nested_form_for @user, :html =&amp;gt; { :multipart =&amp;gt; true } do |f| %&amp;gt;&lt;br /&gt;&amp;lt;div class=&quot;controls&quot;&amp;gt;&lt;br /&gt;&amp;nbsp; Username : &lt;br /&gt;&amp;nbsp; &amp;lt;%= f.text_field :name, :class =&amp;gt; &#39;text_field&#39; %&amp;gt;&lt;br /&gt;&amp;lt;/div&amp;gt;&lt;br /&gt;&amp;lt;%= f.fields_for :albums %&amp;gt;&lt;br /&gt;&amp;lt;%= f.link_to_add &quot;Add an album&quot;, :albums %&amp;gt;&lt;br /&gt;&amp;lt;br /&amp;gt;&lt;br /&gt;&amp;lt;br /&amp;gt;&lt;br /&gt;&amp;lt;div class=&quot;controls&quot;&amp;gt;&lt;br /&gt;&amp;nbsp; &amp;lt;%= f.submit nil, :class =&amp;gt; &#39;btn btn-primary&#39; %&amp;gt;&lt;br /&gt;&amp;lt;/div&amp;gt;&lt;br /&gt;&amp;lt;% end %&amp;gt;&lt;/span&gt;&lt;/span&gt;&lt;/blockquote&gt;
&lt;blockquote class=&quot;tr_bq&quot;&gt;
&lt;span style=&quot;font-family: Verdana,sans-serif;&quot;&gt;&lt;span style=&quot;color: red;&quot;&gt;&lt;b&gt;in _album_fields.html.erb :&lt;/b&gt;&lt;/span&gt;&lt;/span&gt;&lt;/blockquote&gt;
&lt;blockquote class=&quot;tr_bq&quot;&gt;
&lt;span style=&quot;font-family: Verdana,sans-serif;&quot;&gt;&lt;span style=&quot;background-color: #cccccc;&quot;&gt;&amp;lt;div class=&quot;controls&quot;&amp;gt;&lt;br /&gt;&amp;nbsp; Album Name : &lt;br /&gt;&amp;nbsp; &amp;lt;%= f.text_field :name, :class =&amp;gt; &#39;text_field&#39; %&amp;gt;&lt;br /&gt;&amp;nbsp; &amp;lt;%= f.link_to_remove &quot;Remove this album&quot; %&amp;gt;&lt;br /&gt;&amp;nbsp; &amp;lt;%= f.fields_for :photos %&amp;gt;&lt;br /&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; &amp;lt;p&amp;gt;&lt;br /&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; &amp;lt;%= f.link_to_add &quot;Add a photo&quot;, :photos %&amp;gt;&lt;br /&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; &amp;lt;/p&amp;gt;&lt;br /&gt;&amp;lt;/div&amp;gt;&lt;/span&gt;&lt;/span&gt;&lt;/blockquote&gt;
&lt;blockquote class=&quot;tr_bq&quot;&gt;
&lt;span style=&quot;font-family: Verdana,sans-serif;&quot;&gt;&lt;span style=&quot;color: red;&quot;&gt;&lt;b&gt;in _photo_fields.html.erb&lt;/b&gt;&lt;/span&gt; :&lt;/span&gt;&lt;/blockquote&gt;
&lt;blockquote class=&quot;tr_bq&quot;&gt;
&lt;span style=&quot;font-family: Verdana,sans-serif;&quot;&gt;&lt;span style=&quot;background-color: #cccccc;&quot;&gt;&amp;lt;div class=&quot;controls offset1&quot;&amp;gt;&lt;br /&gt;&amp;nbsp; File : &lt;br /&gt;&amp;nbsp; &amp;lt;%= f.text_field :tags_name %&amp;gt;&lt;br /&gt;&amp;nbsp; &amp;lt;%= f.file_field :avatar %&amp;gt;&lt;br /&gt;&amp;nbsp; &amp;lt;%= f.link_to_remove &quot;Remove this photo&quot; %&amp;gt;&lt;br /&gt;&amp;lt;/div&amp;gt;&lt;/span&gt;&lt;/span&gt;&lt;/blockquote&gt;
&lt;blockquote class=&quot;tr_bq&quot;&gt;
&lt;span style=&quot;font-family: Verdana,sans-serif;&quot;&gt;&lt;span style=&quot;color: red;&quot;&gt;&lt;b&gt;in show_albums.html.erb&lt;/b&gt; :&lt;/span&gt;&lt;/span&gt;&lt;/blockquote&gt;
&lt;blockquote class=&quot;tr_bq&quot;&gt;
&lt;span style=&quot;font-family: Verdana,sans-serif;&quot;&gt;&lt;span style=&quot;background-color: #cccccc;&quot;&gt;&amp;lt;% thumbnails = get_photos(@albums) if @albums %&amp;gt;&lt;br /&gt;&amp;nbsp;&amp;lt;% if thumbnails %&amp;gt;&lt;br /&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; &amp;lt;% thumbnails.each do |thumb| %&amp;gt;&lt;br /&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; &amp;lt;%= thumb.html_safe&amp;nbsp; %&amp;gt;&lt;br /&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; &amp;lt;% end %&amp;gt;&lt;br /&gt;&amp;nbsp;&amp;lt;% end %&amp;gt;&lt;br /&gt;&amp;nbsp;&amp;lt;%= show_tags @albums %&amp;gt;&lt;/span&gt;&lt;/span&gt; &lt;/blockquote&gt;
&lt;span style=&quot;font-family: Verdana,sans-serif;&quot;&gt;&lt;br /&gt;&lt;/span&gt;
&lt;span style=&quot;font-family: Verdana,sans-serif;&quot;&gt;&lt;b&gt;Step 8 :&amp;nbsp; Add dropbox.yml in config folder with following data :&lt;/b&gt;&lt;/span&gt;&lt;br /&gt;
&lt;span style=&quot;font-family: Verdana,sans-serif;&quot;&gt;&lt;br /&gt;&lt;/span&gt;
&lt;br /&gt;
&lt;blockquote class=&quot;tr_bq&quot;&gt;
&lt;span style=&quot;font-family: Verdana,sans-serif;&quot;&gt;&lt;span style=&quot;background-color: #cccccc;&quot;&gt;app_key: &amp;lt;%= ENV[&quot;DROPBOX_APP_KEY&quot;] %&amp;gt; &lt;br /&gt;app_secret: &amp;lt;%= ENV[&quot;DROPBOX_APP_SECRET&quot;] %&amp;gt; &lt;br /&gt;access_token: &amp;lt;%= ENV[&quot;DROPBOX_ACCESS_TOKEN&quot;] %&amp;gt; &lt;br /&gt;access_token_secret: &amp;lt;%= ENV[&quot;DROPBOX_ACCESS_TOKEN_SECRET&quot;] %&amp;gt; &lt;br /&gt;user_id: &amp;lt;%= ENV[&quot;DROPBOX_USER_ID&quot;] %&amp;gt; &lt;/span&gt;&lt;/span&gt;&lt;/blockquote&gt;
&lt;span style=&quot;font-family: Verdana,sans-serif;&quot;&gt;&lt;br /&gt;&lt;/span&gt;
&lt;span style=&quot;font-family: Verdana,sans-serif;&quot;&gt;These variables are Environment variables in environments files.&lt;/span&gt;&lt;br /&gt;
&lt;span style=&quot;font-family: Verdana,sans-serif;&quot;&gt;&lt;br /&gt;&lt;/span&gt;
&lt;span style=&quot;font-family: Verdana,sans-serif;&quot;&gt;For detailed setup for paperclip-dropbox gem visit&lt;/span&gt;&lt;br /&gt;
&lt;blockquote class=&quot;tr_bq&quot;&gt;
&lt;span style=&quot;font-family: Verdana,sans-serif;&quot;&gt;&lt;a href=&quot;https://github.com/janko-m/paperclip-dropbox&quot; target=&quot;_blank&quot;&gt;https://github.com/janko-m/paperclip-dropbox&lt;/a&gt;&amp;nbsp;&lt;/span&gt;&lt;/blockquote&gt;
&lt;span style=&quot;font-family: Verdana,sans-serif;&quot;&gt;&lt;br /&gt;&lt;/span&gt;
&lt;span style=&quot;font-family: Verdana,sans-serif;&quot;&gt;&lt;b&gt;Step 9 : Setup Twitter Bootstrap &lt;/b&gt;&lt;span style=&quot;background-color: #cccccc;&quot;&gt;&amp;nbsp;&lt;/span&gt;&lt;/span&gt;&lt;br /&gt;
&lt;blockquote class=&quot;tr_bq&quot;&gt;
&lt;span style=&quot;font-family: Verdana,sans-serif;&quot;&gt;&lt;span style=&quot;background-color: #cccccc;&quot;&gt;rails generate bootstrap:install less&lt;/span&gt;&lt;/span&gt;&lt;br /&gt;
&lt;span style=&quot;font-family: Verdana,sans-serif;&quot;&gt;&lt;span style=&quot;background-color: #cccccc;&quot;&gt;rails g bootstrap:layout application fixed&lt;/span&gt;&lt;/span&gt;&lt;/blockquote&gt;
&lt;span style=&quot;font-family: Verdana,sans-serif;&quot;&gt;&lt;b&gt;Step 10 : Run the application :&lt;/b&gt;&lt;/span&gt;&lt;br /&gt;
&lt;blockquote class=&quot;tr_bq&quot;&gt;
&lt;span style=&quot;font-family: Verdana,sans-serif;&quot;&gt;&lt;span style=&quot;background-color: #cccccc;&quot;&gt;bundle&amp;nbsp;&lt;/span&gt;&lt;/span&gt;&lt;br /&gt;
&lt;span style=&quot;font-family: Verdana,sans-serif;&quot;&gt;&lt;span style=&quot;background-color: #cccccc;&quot;&gt;rake db:create&lt;/span&gt;&lt;/span&gt;&lt;br /&gt;
&lt;span style=&quot;font-family: Verdana,sans-serif;&quot;&gt;&lt;span style=&quot;background-color: #cccccc;&quot;&gt;rake db:migrate&lt;/span&gt;&lt;/span&gt;&lt;br /&gt;
&lt;span style=&quot;font-family: Verdana,sans-serif;&quot;&gt;&lt;span style=&quot;background-color: #cccccc;&quot;&gt;rails s&lt;/span&gt;&lt;/span&gt;&lt;/blockquote&gt;
&lt;br /&gt;
-----------------------------------------------------------------------------------------------------------------------Thanks &lt;br /&gt;
&lt;span style=&quot;font-family: Verdana,sans-serif;&quot;&gt;&lt;br /&gt;&lt;/span&gt;
&lt;span style=&quot;font-family: Verdana,sans-serif;&quot;&gt;&lt;br /&gt;&lt;/span&gt;
&lt;span style=&quot;font-family: Verdana,sans-serif;&quot;&gt;&lt;br /&gt;&lt;/span&gt;
&lt;br /&gt;
&lt;blockquote class=&quot;tr_bq &quot;&gt;
&lt;/blockquote&gt;
&lt;span style=&quot;font-family: Verdana,sans-serif;&quot;&gt;&lt;br /&gt;&lt;/span&gt;
&lt;span style=&quot;font-family: Verdana,sans-serif;&quot;&gt;&lt;br /&gt;&lt;/span&gt;
&lt;span style=&quot;font-family: Verdana,sans-serif;&quot;&gt;&lt;br /&gt;&lt;/span&gt;
&lt;span style=&quot;font-family: Verdana,sans-serif;&quot;&gt;&lt;br /&gt;&lt;/span&gt;
&lt;br /&gt;
&lt;blockquote class=&quot;tr_bq&quot;&gt;
&lt;blockquote class=&quot;tr_bq&quot;&gt;
&lt;span style=&quot;font-family: Verdana,sans-serif;&quot;&gt;&lt;br /&gt;&amp;nbsp;&lt;/span&gt;&lt;/blockquote&gt;
&lt;/blockquote&gt;
&lt;span style=&quot;font-family: Verdana,sans-serif;&quot;&gt;&lt;br /&gt;&lt;/span&gt;
&lt;span style=&quot;font-family: Verdana,sans-serif;&quot;&gt;&lt;br /&gt;&lt;/span&gt;
&lt;span style=&quot;font-family: Verdana,sans-serif;&quot;&gt;&lt;br /&gt;&lt;/span&gt;
&lt;span style=&quot;font-family: Verdana,sans-serif;&quot;&gt;&lt;br /&gt;&lt;/span&gt;
&lt;br /&gt;
&lt;span style=&quot;font-family: Verdana,sans-serif;&quot;&gt;&lt;br /&gt;&lt;/span&gt;
&lt;span style=&quot;font-family: Verdana,sans-serif;&quot;&gt;&lt;br /&gt;&lt;/span&gt;
&lt;span style=&quot;font-family: Verdana,sans-serif;&quot;&gt;&lt;br /&gt;&lt;/span&gt;
&lt;span style=&quot;font-family: Verdana,sans-serif;&quot;&gt;&lt;br /&gt;&lt;/span&gt;
&lt;span style=&quot;font-family: Verdana,sans-serif;&quot;&gt;&lt;br /&gt;&lt;/span&gt;
&lt;span style=&quot;font-family: Verdana,sans-serif;&quot;&gt;&lt;br /&gt;&lt;/span&gt;
&lt;span style=&quot;font-family: Verdana,sans-serif;&quot;&gt;&lt;br /&gt;&lt;/span&gt;
&lt;br /&gt;
&lt;span style=&quot;font-family: Verdana,sans-serif;&quot;&gt;&lt;br /&gt;&lt;/span&gt;&lt;/div&gt;
</content><link rel='replies' type='application/atom+xml' href='http://rorashish.blogspot.com/feeds/772845902236581222/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://rorashish.blogspot.com/2012/12/using-nestedforms-gem-dropbox-paperclip.html#comment-form' title='3 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/2936127337406425108/posts/default/772845902236581222'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/2936127337406425108/posts/default/772845902236581222'/><link rel='alternate' type='text/html' href='http://rorashish.blogspot.com/2012/12/using-nestedforms-gem-dropbox-paperclip.html' title='Using nested_forms gem + dropbox-paperclip + twitter-bootstrap'/><author><name>Anonymous</name><uri>http://www.blogger.com/profile/14643110071701140642</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='16' height='16' src='https://img1.blogblog.com/img/b16-rounded.gif'/></author><thr:total>3</thr:total><georss:featurename>Main St, Hiranandani Gardens, Powai, Mumbai, Maharashtra, India</georss:featurename><georss:point>19.119219453414111 72.909049987792969</georss:point><georss:box>19.089213453414111 72.869567987792962 19.149225453414111 72.948531987792975</georss:box></entry><entry><id>tag:blogger.com,1999:blog-2936127337406425108.post-6299652938576120490</id><published>2012-10-22T13:45:00.000+05:30</published><updated>2012-10-22T13:45:13.640+05:30</updated><category scheme="http://www.blogger.com/atom/ns#" term="clone git branch"/><category scheme="http://www.blogger.com/atom/ns#" term="cloning a branch git"/><category scheme="http://www.blogger.com/atom/ns#" term="git"/><category scheme="http://www.blogger.com/atom/ns#" term="git clone"/><category scheme="http://www.blogger.com/atom/ns#" term="git clone branch"/><title type='text'>Cloning a specific GIT branch from a repository</title><content type='html'>&lt;div dir=&quot;ltr&quot; style=&quot;text-align: left;&quot; trbidi=&quot;on&quot;&gt;
&lt;br /&gt;
&lt;span style=&quot;font-family: Verdana, sans-serif; font-size: large;&quot;&gt;&lt;b&gt;Step 1 :&lt;/b&gt; Clone the master branch&lt;/span&gt;&lt;br /&gt;
&lt;blockquote class=&quot;tr_bq&quot;&gt;
&lt;span style=&quot;font-family: Verdana, sans-serif;&quot;&gt;git clone &amp;lt;repo master&amp;gt;&lt;/span&gt;&lt;/blockquote&gt;
&lt;span style=&quot;font-family: Verdana, sans-serif; font-size: large;&quot;&gt;&lt;b&gt;Step 2 : &lt;/b&gt;Clone the specific GIT branch&lt;/span&gt;&lt;br /&gt;
&lt;blockquote class=&quot;tr_bq&quot;&gt;
&lt;span style=&quot;font-family: Verdana, sans-serif;&quot;&gt;git fetch origin +branchname:branchname&lt;/span&gt;&lt;/blockquote&gt;
&lt;span style=&quot;font-family: Verdana, sans-serif; font-size: large;&quot;&gt;&lt;b&gt;Step 3 :&lt;/b&gt; Switch to the branch&lt;/span&gt;&lt;br /&gt;
&lt;blockquote class=&quot;tr_bq&quot;&gt;
&lt;span style=&quot;font-family: Verdana, sans-serif;&quot;&gt;git checkout branchname&lt;/span&gt;&lt;/blockquote&gt;
&lt;span style=&quot;font-family: Verdana, sans-serif; font-size: large;&quot;&gt;&lt;b&gt;Step 4 :&lt;/b&gt; Check the file difference between the master and the branch&amp;nbsp;&lt;/span&gt;&lt;br /&gt;
&lt;blockquote class=&quot;tr_bq&quot;&gt;
&lt;span style=&quot;font-family: Verdana, sans-serif;&quot;&gt;git diff --name-status master..sibos&lt;/span&gt;&lt;/blockquote&gt;
&lt;br /&gt;
&lt;/div&gt;
</content><link rel='replies' type='application/atom+xml' href='http://rorashish.blogspot.com/feeds/6299652938576120490/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://rorashish.blogspot.com/2012/10/cloning-specific-git-branch-from.html#comment-form' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/2936127337406425108/posts/default/6299652938576120490'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/2936127337406425108/posts/default/6299652938576120490'/><link rel='alternate' type='text/html' href='http://rorashish.blogspot.com/2012/10/cloning-specific-git-branch-from.html' title='Cloning a specific GIT branch from a repository'/><author><name>Anonymous</name><uri>http://www.blogger.com/profile/14643110071701140642</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='16' height='16' src='https://img1.blogblog.com/img/b16-rounded.gif'/></author><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-2936127337406425108.post-4696690851759798899</id><published>2012-09-28T00:29:00.000+05:30</published><updated>2012-09-28T00:33:52.073+05:30</updated><category scheme="http://www.blogger.com/atom/ns#" term="git repo from svn"/><category scheme="http://www.blogger.com/atom/ns#" term="git svn clone"/><category scheme="http://www.blogger.com/atom/ns#" term="migrate svn repo"/><category scheme="http://www.blogger.com/atom/ns#" term="migrating repositories"/><category scheme="http://www.blogger.com/atom/ns#" term="move svn to git"/><category scheme="http://www.blogger.com/atom/ns#" term="push to git from svn"/><category scheme="http://www.blogger.com/atom/ns#" term="svn git migration"/><category scheme="http://www.blogger.com/atom/ns#" term="svn git repo migration"/><category scheme="http://www.blogger.com/atom/ns#" term="svn to git"/><title type='text'>Migrating code from SVN to GIT</title><content type='html'>&lt;div dir=&quot;ltr&quot; style=&quot;text-align: left;&quot; trbidi=&quot;on&quot;&gt;
Install git-svn on ubuntu or linux&lt;br /&gt;
&lt;br /&gt;
Simple command to begin with &lt;br /&gt;
&lt;blockquote class=&quot;tr_bq&quot;&gt;
$ git-svn clone &amp;lt;svn repo link&amp;gt; --no-metadata -s my_project&lt;/blockquote&gt;
&lt;br /&gt;
You need to do a bit of post-import cleanup. For one thing, you should clean up the weird references that git svn set up. First you’ll move the tags so they’re actual tags rather than strange remote branches, and then you’ll move the rest of the branches so they’re local.&lt;br /&gt;
&lt;br /&gt;
To move the tags to be proper Git tags, run&lt;br /&gt;
&lt;br /&gt;
&lt;blockquote class=&quot;tr_bq&quot;&gt;
$ cp -Rf .git/refs/remotes/tags/* .git/refs/tags/&lt;br /&gt;
$ rm -Rf .git/refs/remotes/tags&lt;/blockquote&gt;
&lt;br /&gt;
This takes the references that were remote branches that started with tag/ and makes them real (lightweight) tags.&lt;br /&gt;
&lt;br /&gt;
Next, move the rest of the references under refs/remotes to be local branches:&lt;br /&gt;
&lt;br /&gt;
&lt;blockquote class=&quot;tr_bq&quot;&gt;
$ cp -Rf .git/refs/remotes/* .git/refs/heads/&lt;br /&gt;
$ rm -Rf .git/refs/remotes&lt;/blockquote&gt;
&lt;br /&gt;
Now all the old branches are real Git branches and all the old tags are real Git tags. The last thing to do is add your new Git server as a remote and push to it. Here is an example of adding your server as a remote:&lt;br /&gt;
&lt;br /&gt;
&lt;blockquote class=&quot;tr_bq&quot;&gt;
$ git remote add origin git@my-git-server:myrepository.git&lt;/blockquote&gt;
&lt;br /&gt;
Because you want all your branches and tags to go up, you can now run this:&lt;br /&gt;
&lt;br /&gt;
&lt;blockquote&gt;
$ git push origin --all&lt;/blockquote&gt;
&lt;/div&gt;
</content><link rel='replies' type='application/atom+xml' href='http://rorashish.blogspot.com/feeds/4696690851759798899/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://rorashish.blogspot.com/2012/09/migrating-code-from-svn-to-git.html#comment-form' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/2936127337406425108/posts/default/4696690851759798899'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/2936127337406425108/posts/default/4696690851759798899'/><link rel='alternate' type='text/html' href='http://rorashish.blogspot.com/2012/09/migrating-code-from-svn-to-git.html' title='Migrating code from SVN to GIT'/><author><name>Anonymous</name><uri>http://www.blogger.com/profile/14643110071701140642</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='16' height='16' src='https://img1.blogblog.com/img/b16-rounded.gif'/></author><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-2936127337406425108.post-3395808416317064146</id><published>2012-08-11T00:46:00.000+05:30</published><updated>2012-08-11T00:48:12.081+05:30</updated><category scheme="http://www.blogger.com/atom/ns#" term="heroku readline"/><category scheme="http://www.blogger.com/atom/ns#" term="readline"/><category scheme="http://www.blogger.com/atom/ns#" term="readline error"/><category scheme="http://www.blogger.com/atom/ns#" term="rvm readline"/><category scheme="http://www.blogger.com/atom/ns#" term="ubuntu readline"/><title type='text'>Fix Readline error Ubuntu</title><content type='html'>&lt;div dir=&quot;ltr&quot; style=&quot;text-align: left;&quot; trbidi=&quot;on&quot;&gt;
&lt;span style=&quot;font-family: &amp;quot;Trebuchet MS&amp;quot;,sans-serif;&quot;&gt;Fix readline error with Ruby&lt;/span&gt; &lt;br /&gt;
&lt;br /&gt;
&lt;blockquote class=&quot;tr_bq&quot;&gt;
sudo apt-get install libreadline-dev&lt;br /&gt;
&lt;br /&gt;
cd ~/.rvm/src/ruby-1.8.7-p249/ext/readline&lt;br /&gt;
&lt;br /&gt;
ruby extconf.rb &amp;amp;&amp;amp; make &amp;amp;&amp;amp; make install&lt;/blockquote&gt;
&lt;br /&gt;
&lt;br /&gt;
Thanks &lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://rorashish.blogspot.com/feeds/3395808416317064146/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://rorashish.blogspot.com/2012/08/fix-readline-error-ubuntu.html#comment-form' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/2936127337406425108/posts/default/3395808416317064146'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/2936127337406425108/posts/default/3395808416317064146'/><link rel='alternate' type='text/html' href='http://rorashish.blogspot.com/2012/08/fix-readline-error-ubuntu.html' title='Fix Readline error Ubuntu'/><author><name>Anonymous</name><uri>http://www.blogger.com/profile/14643110071701140642</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='16' height='16' src='https://img1.blogblog.com/img/b16-rounded.gif'/></author><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-2936127337406425108.post-6498046887761165460</id><published>2012-08-10T17:26:00.002+05:30</published><updated>2012-08-10T17:26:54.723+05:30</updated><category scheme="http://www.blogger.com/atom/ns#" term="capd install git clone"/><category scheme="http://www.blogger.com/atom/ns#" term="capistrano"/><category scheme="http://www.blogger.com/atom/ns#" term="git capistrano"/><category scheme="http://www.blogger.com/atom/ns#" term="git clone too many arguments"/><title type='text'>Capistrano + GIT : Too many arguments while deployment</title><content type='html'>&lt;div dir=&quot;ltr&quot; style=&quot;text-align: left;&quot; trbidi=&quot;on&quot;&gt;
&lt;div style=&quot;font-family: &amp;quot;Trebuchet MS&amp;quot;,sans-serif;&quot;&gt;
&lt;b&gt;&lt;u&gt;Issue &lt;/u&gt;: shell command failed with return code 33024&lt;/b&gt;&lt;/div&gt;
&lt;div style=&quot;font-family: &amp;quot;Trebuchet MS&amp;quot;,sans-serif;&quot;&gt;
&lt;/div&gt;
&lt;div style=&quot;font-family: &amp;quot;Trebuchet MS&amp;quot;,sans-serif;&quot;&gt;
&lt;br /&gt;&lt;/div&gt;
&lt;div style=&quot;font-family: &amp;quot;Trebuchet MS&amp;quot;,sans-serif;&quot;&gt;
It&#39;s a ruby + git clone + windows issue.&lt;/div&gt;
&lt;div style=&quot;font-family: &amp;quot;Trebuchet MS&amp;quot;,sans-serif;&quot;&gt;
&lt;br /&gt;&lt;/div&gt;
&lt;div style=&quot;font-family: &amp;quot;Trebuchet MS&amp;quot;,sans-serif;&quot;&gt;
If
 I chain commands with &amp;amp;&amp;amp; while calling system(cmd) from ruby, 
chaining &quot;git clone&quot; with other commands is not fine. Git clone 
perceives the chained commands as its own continuation, i.e. as a 
destination directory, unless I run it from the command line. &lt;/div&gt;
&lt;div style=&quot;font-family: &amp;quot;Trebuchet MS&amp;quot;,sans-serif;&quot;&gt;
As I
 couldn&#39;t find any references or solutions to this problem on the 
internet, I put a hack to capistrano code, so &quot;git clone&quot; is executed 
separately.&amp;nbsp;&lt;/div&gt;
&lt;div style=&quot;font-family: &amp;quot;Trebuchet MS&amp;quot;,sans-serif;&quot;&gt;
&lt;br /&gt;&lt;/div&gt;
&lt;div style=&quot;font-family: &amp;quot;Trebuchet MS&amp;quot;,sans-serif;&quot;&gt;
In &amp;lt;ruby 
directory&amp;gt;\lib\ruby\gems\1.8\gems\capistrano-2.5.18\lib\capistrano\recipes\deploy\strategy\base.rb
 after the line 53 (cmd = cmd.split...)&lt;br /&gt;add the following lines:&lt;/div&gt;
&lt;div style=&quot;font-family: &amp;quot;Trebuchet MS&amp;quot;,sans-serif;&quot;&gt;
if cmd =~ /\s\&amp;amp;\&amp;amp;\s/ &amp;amp;&amp;amp; cmd =~ /^git\s+clone/ &lt;br /&gt;&amp;nbsp; &amp;nbsp;cmd1, cmd = cmd.split(&quot; &amp;amp;&amp;amp; &quot;, 2)&lt;br /&gt;&amp;nbsp; &amp;nbsp; super(cmd1)&lt;br /&gt;end&lt;/div&gt;
&lt;div style=&quot;font-family: &amp;quot;Trebuchet MS&amp;quot;,sans-serif;&quot;&gt;
&lt;br /&gt;&lt;/div&gt;
&lt;div style=&quot;font-family: &amp;quot;Trebuchet MS&amp;quot;,sans-serif;&quot;&gt;
it
 checks if it&#39;s a chained command and the first command is &quot;git clone&quot;, 
and if such it executes it separately. It may not work for all possible 
cases.&lt;/div&gt;
&lt;div style=&quot;font-family: &amp;quot;Trebuchet MS&amp;quot;,sans-serif;&quot;&gt;
&lt;br /&gt;&lt;/div&gt;
&lt;div style=&quot;font-family: &amp;quot;Trebuchet MS&amp;quot;,sans-serif;&quot;&gt;
Also you can try using ubuntu from your local.&lt;/div&gt;
&lt;div style=&quot;font-family: &amp;quot;Trebuchet MS&amp;quot;,sans-serif;&quot;&gt;
&lt;br /&gt;&lt;/div&gt;
&lt;div style=&quot;font-family: &amp;quot;Trebuchet MS&amp;quot;,sans-serif;&quot;&gt;
&amp;nbsp;&lt;/div&gt;
&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://rorashish.blogspot.com/feeds/6498046887761165460/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://rorashish.blogspot.com/2012/08/capistrano-git-too-many-arguments-while.html#comment-form' title='5 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/2936127337406425108/posts/default/6498046887761165460'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/2936127337406425108/posts/default/6498046887761165460'/><link rel='alternate' type='text/html' href='http://rorashish.blogspot.com/2012/08/capistrano-git-too-many-arguments-while.html' title='Capistrano + GIT : Too many arguments while deployment'/><author><name>Anonymous</name><uri>http://www.blogger.com/profile/14643110071701140642</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='16' height='16' src='https://img1.blogblog.com/img/b16-rounded.gif'/></author><thr:total>5</thr:total></entry><entry><id>tag:blogger.com,1999:blog-2936127337406425108.post-4657440977538167265</id><published>2012-08-09T13:58:00.000+05:30</published><updated>2012-08-09T14:00:18.022+05:30</updated><category scheme="http://www.blogger.com/atom/ns#" term="imagemagick"/><category scheme="http://www.blogger.com/atom/ns#" term="rails"/><category scheme="http://www.blogger.com/atom/ns#" term="rmagic"/><category scheme="http://www.blogger.com/atom/ns#" term="rmagick"/><title type='text'>Installing RMagick with Imagemagic on Windows 7/Vista</title><content type='html'>&lt;div dir=&quot;ltr&quot; style=&quot;text-align: left;&quot; trbidi=&quot;on&quot;&gt;
&lt;div class=&quot;body&quot; style=&quot;font-family: &amp;quot;Trebuchet MS&amp;quot;,sans-serif;&quot;&gt;
&lt;div class=&quot;formatted-content&quot;&gt;
&lt;div class=&quot;content-body markdown-body markdown-format&quot;&gt;
From : &lt;a href=&quot;https://github.com/rmagick/rmagick/issues/27%20&quot; target=&quot;_blank&quot;&gt;https://github.com/rmagick/rmagick/issues/27 &lt;/a&gt;&lt;br /&gt;
Thanks to :&amp;nbsp; &lt;a href=&quot;https://github.com/wingfire&quot;&gt;https://github.com/wingfire&lt;/a&gt;&lt;br /&gt;
&lt;b&gt;&lt;u&gt;&lt;br /&gt;&lt;/u&gt;&lt;/b&gt;
&lt;b&gt;&lt;u&gt;Working with Windows 7 64bit and Ruby 1.9.3.&lt;/u&gt;&lt;/b&gt;&lt;br /&gt;
&lt;br /&gt;
1. Install Ghostscript&lt;br /&gt;&lt;a href=&quot;http://downloads.sourceforge.net/project/ghostscript/GPL%20Ghostscript/9.05/gs905w32.exe&quot;&gt;http://downloads.sourceforge.net/project/ghostscript/GPL%20Ghostscript/9.05/gs905w32.exe&lt;/a&gt;&lt;/div&gt;
&lt;div class=&quot;content-body markdown-body markdown-format&quot;&gt;
&lt;br /&gt;2. Install Imagemagick&lt;br /&gt;
Use the 32 bit version, 64bit is not working.&lt;br /&gt;&lt;a href=&quot;http://www.imagemagick.org/download/binaries/ImageMagick-6.7.6-1-Q16-windows-dll.exe&quot;&gt;http://www.imagemagick.org/download/binaries/ImageMagick-6.7.6-1-Q16-windows-dll.exe&lt;/a&gt; (2012-03-22)&lt;br /&gt;
Install dev headers (Check!)&lt;br /&gt;
Install into C:\opt\&lt;/div&gt;
&lt;div class=&quot;content-body markdown-body markdown-format&quot;&gt;
&lt;br /&gt;
3. Restart the console/cmd prompt/IDE/.. or just restart windows to make Imagemagick commands available &lt;/div&gt;
&lt;div class=&quot;content-body markdown-body markdown-format&quot;&gt;
&lt;br /&gt;4. Install rmagick&lt;br /&gt;

gem install rmagick --platform=ruby -- 
--with-opt-lib=C:/opt/ImageMagick-6.7.6-Q16/lib 
--with-opt-include=c:/opt/ImageMagick-6.7.6-Q16/include&lt;ol&gt;




&lt;/ol&gt;
&lt;/div&gt;
&lt;/div&gt;
&lt;/div&gt;
&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://rorashish.blogspot.com/feeds/4657440977538167265/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://rorashish.blogspot.com/2012/08/installing-rmagick-with-imagemagic-on.html#comment-form' title='4 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/2936127337406425108/posts/default/4657440977538167265'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/2936127337406425108/posts/default/4657440977538167265'/><link rel='alternate' type='text/html' href='http://rorashish.blogspot.com/2012/08/installing-rmagick-with-imagemagic-on.html' title='Installing RMagick with Imagemagic on Windows 7/Vista'/><author><name>Anonymous</name><uri>http://www.blogger.com/profile/14643110071701140642</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='16' height='16' src='https://img1.blogblog.com/img/b16-rounded.gif'/></author><thr:total>4</thr:total></entry><entry><id>tag:blogger.com,1999:blog-2936127337406425108.post-4046954637850624606</id><published>2012-06-13T19:56:00.000+05:30</published><updated>2012-06-13T19:56:29.292+05:30</updated><category scheme="http://www.blogger.com/atom/ns#" term="os mac"/><category scheme="http://www.blogger.com/atom/ns#" term="ruby mac"/><category scheme="http://www.blogger.com/atom/ns#" term="ruby on mac os"/><category scheme="http://www.blogger.com/atom/ns#" term="ruby on rails mac"/><category scheme="http://www.blogger.com/atom/ns#" term="ruby on rails rvm mac"/><category scheme="http://www.blogger.com/atom/ns#" term="ruby rvm"/><category scheme="http://www.blogger.com/atom/ns#" term="rvm install ruby on mac os"/><title type='text'>Installing Ruby on Mac OS</title><content type='html'>&lt;div dir=&quot;ltr&quot; style=&quot;text-align: left;&quot; trbidi=&quot;on&quot;&gt;
&lt;h3 style=&quot;font-family: &amp;quot;Trebuchet MS&amp;quot;,sans-serif;&quot;&gt;
&lt;span style=&quot;font-size: small;&quot;&gt;STEP 1 Installing XCode&lt;/span&gt;&lt;/h3&gt;
&lt;hr style=&quot;font-family: &amp;quot;Trebuchet MS&amp;quot;,sans-serif;&quot; /&gt;
&lt;div style=&quot;font-family: &amp;quot;Trebuchet MS&amp;quot;,sans-serif;&quot;&gt;
&lt;span style=&quot;font-size: small;&quot;&gt;Please install &lt;code&gt;XCode + Developer Tools&lt;/code&gt; from the App Center.&lt;br /&gt;
XCode is needed to install the Developer tools used in compilation of the Ruby packages for installation on the system.&lt;/span&gt;&lt;/div&gt;
&lt;h3 style=&quot;font-family: &amp;quot;Trebuchet MS&amp;quot;,sans-serif;&quot;&gt;
&lt;span style=&quot;font-size: small;&quot;&gt;STEP 2 Install RVM&lt;/span&gt;&lt;/h3&gt;
&lt;hr style=&quot;font-family: &amp;quot;Trebuchet MS&amp;quot;,sans-serif;&quot; /&gt;
&lt;div style=&quot;font-family: &amp;quot;Trebuchet MS&amp;quot;,sans-serif;&quot;&gt;
&lt;span style=&quot;font-size: small;&quot;&gt;Install RVM using the command &lt;/span&gt;&lt;/div&gt;
&lt;ul style=&quot;font-family: &amp;quot;Trebuchet MS&amp;quot;,sans-serif;&quot;&gt;
&lt;li&gt;&lt;span style=&quot;font-size: small;&quot;&gt;&lt;code&gt;curl -L get.rvm.io | bash -s stable&lt;/code&gt;&lt;/span&gt;&lt;/li&gt;
&lt;/ul&gt;
&lt;div style=&quot;font-family: &amp;quot;Trebuchet MS&amp;quot;,sans-serif;&quot;&gt;
&lt;span style=&quot;font-size: small;&quot;&gt;This will install RVM on your system.&lt;br /&gt;
Please close and open the terminal again to load RVM.&lt;br /&gt;
To verify the RVM installation , open Terminal and type   &lt;/span&gt;&lt;/div&gt;
&lt;ul style=&quot;font-family: &amp;quot;Trebuchet MS&amp;quot;,sans-serif;&quot;&gt;
&lt;li&gt;  &lt;span style=&quot;font-size: small;&quot;&gt;&lt;code&gt;rvm requirements&lt;/code&gt;&lt;/span&gt;
&lt;/li&gt;
&lt;/ul&gt;
&lt;div style=&quot;font-family: &amp;quot;Trebuchet MS&amp;quot;,sans-serif;&quot;&gt;
&lt;span style=&quot;font-size: small;&quot;&gt;This will show a help doc.  &lt;/span&gt;&lt;/div&gt;
&lt;h3 style=&quot;font-family: &amp;quot;Trebuchet MS&amp;quot;,sans-serif;&quot;&gt;
&lt;span style=&quot;font-size: small;&quot;&gt;Step 3  Installing required RVM packages before installing Ruby&lt;/span&gt;&lt;/h3&gt;
&lt;hr style=&quot;font-family: &amp;quot;Trebuchet MS&amp;quot;,sans-serif;&quot; /&gt;
&lt;div style=&quot;font-family: &amp;quot;Trebuchet MS&amp;quot;,sans-serif;&quot;&gt;
&lt;span style=&quot;font-size: small;&quot;&gt;Open Terminal and run the below mentioned commands one after the another   &lt;/span&gt;&lt;/div&gt;
&lt;ul style=&quot;font-family: &amp;quot;Trebuchet MS&amp;quot;,sans-serif;&quot;&gt;
&lt;li&gt;&lt;span style=&quot;font-size: small;&quot;&gt;&lt;code&gt;rvm pkg install zlib&lt;/code&gt;&lt;/span&gt;&lt;/li&gt;
&lt;li&gt;&lt;span style=&quot;font-size: small;&quot;&gt;&lt;code&gt;rvm pkg install openssl&lt;/code&gt;&lt;/span&gt;&lt;/li&gt;
&lt;li&gt;&lt;span style=&quot;font-size: small;&quot;&gt;&lt;code&gt;rvm pkg install iconv&lt;/code&gt;&lt;/span&gt;&lt;/li&gt;
&lt;li&gt;&lt;span style=&quot;font-size: small;&quot;&gt;&lt;code&gt;rvm pkg install readline&lt;/code&gt;&lt;/span&gt;&lt;/li&gt;
&lt;li&gt;&lt;span style=&quot;font-size: small;&quot;&gt;&lt;code&gt;rvm pkg install autoconf&lt;/code&gt;&lt;/span&gt;&lt;/li&gt;
&lt;/ul&gt;
&lt;h3 style=&quot;font-family: &amp;quot;Trebuchet MS&amp;quot;,sans-serif;&quot;&gt;
&lt;span style=&quot;font-size: small;&quot;&gt;Step 4  Installing Ruby&lt;/span&gt;&lt;/h3&gt;
&lt;hr style=&quot;font-family: &amp;quot;Trebuchet MS&amp;quot;,sans-serif;&quot; /&gt;
&lt;div style=&quot;font-family: &amp;quot;Trebuchet MS&amp;quot;,sans-serif;&quot;&gt;
&lt;span style=&quot;font-size: small;&quot;&gt;Open the Terminal and type the following command &lt;/span&gt;&lt;/div&gt;
&lt;ul style=&quot;font-family: &amp;quot;Trebuchet MS&amp;quot;,sans-serif;&quot;&gt;
&lt;li&gt;&lt;span style=&quot;font-size: small;&quot;&gt;&lt;code&gt;rvm install 1.8.7 --with-gcc=clang&lt;/code&gt;&lt;/span&gt;&lt;/li&gt;
&lt;/ul&gt;
&lt;div style=&quot;font-family: &amp;quot;Trebuchet MS&amp;quot;,sans-serif;&quot;&gt;
&lt;span style=&quot;font-size: small;&quot;&gt;Here 1.8.7 reflects the Ruby version 1.8.7 and the latest patch,
 so to install any specific version or path you specify it by altering 
the above mentioned command eg.&lt;/span&gt;&lt;/div&gt;
&lt;ul style=&quot;font-family: &amp;quot;Trebuchet MS&amp;quot;,sans-serif;&quot;&gt;
&lt;li&gt;&lt;span style=&quot;font-size: small;&quot;&gt;&lt;code&gt;rvm install 1.8.7-p334 --with-gcc=clang&lt;/code&gt;&lt;/span&gt;&lt;/li&gt;
&lt;li&gt;&lt;span style=&quot;font-size: small;&quot;&gt;&lt;code&gt;rvm install 1.9.3 -C --with-gcc=clang&lt;/code&gt;&lt;/span&gt;&lt;/li&gt;
&lt;/ul&gt;
&lt;h3 style=&quot;font-family: &amp;quot;Trebuchet MS&amp;quot;,sans-serif;&quot;&gt;
&lt;span style=&quot;font-size: small;&quot;&gt;Step 5  Verify the installation&lt;/span&gt;&lt;/h3&gt;
&lt;hr style=&quot;font-family: &amp;quot;Trebuchet MS&amp;quot;,sans-serif;&quot; /&gt;
&lt;div style=&quot;font-family: &amp;quot;Trebuchet MS&amp;quot;,sans-serif;&quot;&gt;
&lt;span style=&quot;font-size: small;&quot;&gt;Open a new Terminal window and type  &lt;/span&gt;&lt;/div&gt;
&lt;ul style=&quot;font-family: &amp;quot;Trebuchet MS&amp;quot;,sans-serif;&quot;&gt;
&lt;li&gt;
&lt;span style=&quot;font-size: small;&quot;&gt;&lt;code&gt;rvm list&lt;/code&gt;
This will display the list of the different rubies installed on the system.&lt;br /&gt;
To use a specific Ruby version use the following command &lt;/span&gt;&lt;/li&gt;
&lt;li&gt;
&lt;span style=&quot;font-size: small;&quot;&gt;&lt;code&gt;rvm use 1.8.7&lt;/code&gt;&lt;/span&gt; &lt;/li&gt;
&lt;li&gt;&lt;span style=&quot;font-size: small;&quot;&gt;&lt;code&gt;rvm use 1.8.7-p334&lt;/code&gt;&lt;/span&gt;&lt;/li&gt;
&lt;li&gt;
&lt;span style=&quot;font-size: small;&quot;&gt;&lt;code&gt;rvm use 1.9.3&lt;/code&gt;
To make a Ruby version default for the system use the command &lt;/span&gt;&lt;/li&gt;
&lt;li&gt;&lt;span style=&quot;font-size: small;&quot;&gt;&lt;code&gt;rvm alias create default 1.8.7&lt;/code&gt;&lt;/span&gt;&lt;/li&gt;
&lt;li&gt;&lt;span style=&quot;font-size: small;&quot;&gt;&lt;code&gt;rvm alias create default 1.8.7-p334&lt;/code&gt;&lt;/span&gt;&lt;/li&gt;
&lt;li&gt;
&lt;span style=&quot;font-size: small;&quot;&gt;&lt;code&gt;rvm alias create default 1.9.3&lt;/code&gt;&lt;/span&gt;
&lt;/li&gt;
&lt;/ul&gt;
&lt;div style=&quot;font-family: &amp;quot;Trebuchet MS&amp;quot;,sans-serif;&quot;&gt;
&lt;span style=&quot;font-size: small;&quot;&gt;This Ruby version will be the default version of Ruby on the 
system , to change to other versions of Ruby use the above mentioned 
commands.&lt;br /&gt;
To use default incase of switching use    &lt;/span&gt;&lt;/div&gt;
&lt;ul style=&quot;font-family: &amp;quot;Trebuchet MS&amp;quot;,sans-serif;&quot;&gt;
&lt;li&gt;&lt;span style=&quot;font-size: small;&quot;&gt;&lt;code&gt;rvm use default&lt;/code&gt;&lt;/span&gt;&lt;/li&gt;
&lt;/ul&gt;
&lt;div style=&quot;font-family: &amp;quot;Trebuchet MS&amp;quot;,sans-serif;&quot;&gt;
&lt;span style=&quot;font-size: small;&quot;&gt;To remove RVM from the system use the command &lt;/span&gt;&lt;/div&gt;
&lt;ul style=&quot;font-family: &amp;quot;Trebuchet MS&amp;quot;,sans-serif;&quot;&gt;
&lt;li&gt;&lt;span style=&quot;font-size: small;&quot;&gt;&lt;code&gt;rvm implode&lt;/code&gt;&lt;/span&gt;&lt;/li&gt;
&lt;/ul&gt;
&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://rorashish.blogspot.com/feeds/4046954637850624606/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://rorashish.blogspot.com/2012/06/installing-ruby-on-mac-os.html#comment-form' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/2936127337406425108/posts/default/4046954637850624606'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/2936127337406425108/posts/default/4046954637850624606'/><link rel='alternate' type='text/html' href='http://rorashish.blogspot.com/2012/06/installing-ruby-on-mac-os.html' title='Installing Ruby on Mac OS'/><author><name>Anonymous</name><uri>http://www.blogger.com/profile/14643110071701140642</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='16' height='16' src='https://img1.blogblog.com/img/b16-rounded.gif'/></author><thr:total>0</thr:total><georss:featurename>Mumbai, Maharashtra, India</georss:featurename><georss:point>19.0759837 72.8776559</georss:point><georss:box>18.835877699999998 72.5617989 19.3160897 73.193512899999988</georss:box></entry><entry><id>tag:blogger.com,1999:blog-2936127337406425108.post-1477813065186913415</id><published>2012-06-13T19:54:00.000+05:30</published><updated>2012-06-13T19:59:20.560+05:30</updated><category scheme="http://www.blogger.com/atom/ns#" term="install ruby"/><category scheme="http://www.blogger.com/atom/ns#" term="ruby 1.9.3 install"/><category scheme="http://www.blogger.com/atom/ns#" term="ruby install linux"/><category scheme="http://www.blogger.com/atom/ns#" term="ruby install ubuntu"/><category scheme="http://www.blogger.com/atom/ns#" term="ruby linux"/><category scheme="http://www.blogger.com/atom/ns#" term="ruby on rails"/><category scheme="http://www.blogger.com/atom/ns#" term="ruby on rails linux"/><category scheme="http://www.blogger.com/atom/ns#" term="ruby on ubuntu"/><category scheme="http://www.blogger.com/atom/ns#" term="rvm ruby ubuntu install"/><category scheme="http://www.blogger.com/atom/ns#" term="ubuntu"/><category scheme="http://www.blogger.com/atom/ns#" term="ubuntu 12.04 install ruby"/><title type='text'>Installing Ruby on Ubuntu</title><content type='html'>&lt;div dir=&quot;ltr&quot; style=&quot;text-align: left;&quot; trbidi=&quot;on&quot;&gt;
&lt;h3 style=&quot;font-family: &amp;quot;Trebuchet MS&amp;quot;,sans-serif;&quot;&gt;


&lt;span style=&quot;font-size: small;&quot;&gt;Step 1  Verifying&lt;/span&gt;&lt;/h3&gt;
&lt;hr style=&quot;font-family: &amp;quot;Trebuchet MS&amp;quot;,sans-serif;&quot; /&gt;
&lt;div style=&quot;font-family: &amp;quot;Trebuchet MS&amp;quot;,sans-serif;&quot;&gt;
&lt;span style=&quot;font-size: small;&quot;&gt;Verify the system is update and then run a &lt;code&gt;sudo apt-get update&lt;/code&gt; on the terminal.&lt;/span&gt;&lt;/div&gt;
&lt;h3 style=&quot;font-family: &amp;quot;Trebuchet MS&amp;quot;,sans-serif;&quot;&gt;


&lt;span style=&quot;font-size: small;&quot;&gt;Step 2  Installing RVM on Ubuntu&lt;/span&gt;&lt;/h3&gt;
&lt;hr style=&quot;font-family: &amp;quot;Trebuchet MS&amp;quot;,sans-serif;&quot; /&gt;
&lt;div style=&quot;font-family: &amp;quot;Trebuchet MS&amp;quot;,sans-serif;&quot;&gt;
&lt;span style=&quot;font-size: small;&quot;&gt;Open terminal and type   &lt;/span&gt;&lt;/div&gt;
&lt;ul style=&quot;font-family: &amp;quot;Trebuchet MS&amp;quot;,sans-serif;&quot;&gt;
&lt;li&gt; &lt;span style=&quot;font-size: small;&quot;&gt;&lt;code&gt;curl https://raw.github.com/wayneeseguin/rvm/master/binscripts/rvm-installer | bash -s stable&lt;/code&gt;&lt;/span&gt;
&lt;/li&gt;
&lt;/ul&gt;
&lt;div style=&quot;font-family: &amp;quot;Trebuchet MS&amp;quot;,sans-serif;&quot;&gt;
&lt;span style=&quot;font-size: small;&quot;&gt;This will install RVM on your system.&lt;br /&gt;
Please close and open the terminal again to load RVM.&lt;br /&gt;
To verify the RVM installation , open Terminal and type   &lt;/span&gt;&lt;/div&gt;
&lt;ul style=&quot;font-family: &amp;quot;Trebuchet MS&amp;quot;,sans-serif;&quot;&gt;
&lt;li&gt;  &lt;span style=&quot;font-size: small;&quot;&gt;&lt;code&gt;rvm requirements&lt;/code&gt;&lt;/span&gt;
&lt;/li&gt;
&lt;/ul&gt;
&lt;div style=&quot;font-family: &amp;quot;Trebuchet MS&amp;quot;,sans-serif;&quot;&gt;
&lt;span style=&quot;font-size: small;&quot;&gt;This will show a help doc.  &lt;/span&gt;&lt;/div&gt;
&lt;h3 style=&quot;font-family: &amp;quot;Trebuchet MS&amp;quot;,sans-serif;&quot;&gt;


&lt;span style=&quot;font-size: small;&quot;&gt;Step 3  Installing required RVM packages before installing Ruby&lt;/span&gt;&lt;/h3&gt;
&lt;hr style=&quot;font-family: &amp;quot;Trebuchet MS&amp;quot;,sans-serif;&quot; /&gt;
&lt;div style=&quot;font-family: &amp;quot;Trebuchet MS&amp;quot;,sans-serif;&quot;&gt;
&lt;span style=&quot;font-size: small;&quot;&gt;Open Terminal and run the below mentioned commands one after the another   &lt;/span&gt;&lt;/div&gt;
&lt;ul style=&quot;font-family: &amp;quot;Trebuchet MS&amp;quot;,sans-serif;&quot;&gt;
&lt;li&gt;&lt;span style=&quot;font-size: small;&quot;&gt;&lt;code&gt;rvm pkg install zlib&lt;/code&gt;&lt;/span&gt;&lt;/li&gt;
&lt;li&gt;&lt;span style=&quot;font-size: small;&quot;&gt;&lt;code&gt;rvm pkg install openssl&lt;/code&gt;&lt;/span&gt;&lt;/li&gt;
&lt;li&gt;&lt;span style=&quot;font-size: small;&quot;&gt;&lt;code&gt;rvm pkg install iconv&lt;/code&gt;&lt;/span&gt;&lt;/li&gt;
&lt;li&gt;&lt;span style=&quot;font-size: small;&quot;&gt;&lt;code&gt;rvm pkg install readline&lt;/code&gt;&lt;/span&gt;&lt;/li&gt;
&lt;li&gt;&lt;span style=&quot;font-size: small;&quot;&gt;&lt;code&gt;rvm pkg install autoconf&lt;/code&gt;&lt;/span&gt;&lt;/li&gt;
&lt;/ul&gt;
&lt;h3 style=&quot;font-family: &amp;quot;Trebuchet MS&amp;quot;,sans-serif;&quot;&gt;


&lt;span style=&quot;font-size: small;&quot;&gt;Step 4  Installing Ruby&lt;/span&gt;&lt;/h3&gt;
&lt;hr style=&quot;font-family: &amp;quot;Trebuchet MS&amp;quot;,sans-serif;&quot; /&gt;
&lt;div style=&quot;font-family: &amp;quot;Trebuchet MS&amp;quot;,sans-serif;&quot;&gt;
&lt;span style=&quot;font-size: small;&quot;&gt;Open the Terminal and type the following command &lt;/span&gt;&lt;/div&gt;
&lt;ul style=&quot;font-family: &amp;quot;Trebuchet MS&amp;quot;,sans-serif;&quot;&gt;
&lt;li&gt;&lt;span style=&quot;font-size: small;&quot;&gt;&lt;code&gt;rvm install 1.8.7 -C --with-openssl-dir=$rvm_path/usr  --with-zlib-dir=$rvm_path/usr&lt;/code&gt;&lt;/span&gt;&lt;/li&gt;
&lt;/ul&gt;
&lt;div style=&quot;font-family: &amp;quot;Trebuchet MS&amp;quot;,sans-serif;&quot;&gt;
&lt;span style=&quot;font-size: small;&quot;&gt;Here 1.8.7 reflects the Ruby version 1.8.7 and the latest patch,
 so to install any specific version or path you specify it by altering 
the above mentioned command eg.&lt;/span&gt;&lt;/div&gt;
&lt;ul style=&quot;font-family: &amp;quot;Trebuchet MS&amp;quot;,sans-serif;&quot;&gt;
&lt;li&gt;&lt;span style=&quot;font-size: small;&quot;&gt;&lt;code&gt;rvm install 1.8.7-p334 -C --with-openssl-dir=$rvm_path/usr  --with-zlib-dir=$rvm_path/usr&lt;/code&gt;&lt;/span&gt;&lt;/li&gt;
&lt;li&gt;&lt;span style=&quot;font-size: small;&quot;&gt;&lt;code&gt;rvm install 1.9.3 -C --with-openssl-dir=$rvm_path/usr  --with-zlib-dir=$rvm_path/usr&lt;/code&gt;&lt;/span&gt;&lt;/li&gt;
&lt;/ul&gt;
&lt;h3 style=&quot;font-family: &amp;quot;Trebuchet MS&amp;quot;,sans-serif;&quot;&gt;


&lt;span style=&quot;font-size: small;&quot;&gt;Step 5  Verify the installation&lt;/span&gt;&lt;/h3&gt;
&lt;hr style=&quot;font-family: &amp;quot;Trebuchet MS&amp;quot;,sans-serif;&quot; /&gt;
&lt;div style=&quot;font-family: &amp;quot;Trebuchet MS&amp;quot;,sans-serif;&quot;&gt;
&lt;span style=&quot;font-size: small;&quot;&gt;Open a new Terminal window and type  &lt;/span&gt;&lt;/div&gt;
&lt;ul style=&quot;font-family: &amp;quot;Trebuchet MS&amp;quot;,sans-serif;&quot;&gt;
&lt;li&gt;
&lt;span style=&quot;font-size: small;&quot;&gt;&lt;code&gt;rvm list&lt;/code&gt;
This will display the list of the different rubies installed on the system.&lt;br /&gt;
To use a specific Ruby version use the following command &lt;/span&gt;&lt;/li&gt;
&lt;li&gt;
&lt;span style=&quot;font-size: small;&quot;&gt;&lt;code&gt;rvm use 1.8.7&lt;/code&gt;&lt;/span&gt; &lt;/li&gt;
&lt;li&gt;&lt;span style=&quot;font-size: small;&quot;&gt;&lt;code&gt;rvm use 1.8.7-p334&lt;/code&gt;&lt;/span&gt;&lt;/li&gt;
&lt;li&gt;
&lt;span style=&quot;font-size: small;&quot;&gt;&lt;code&gt;rvm use 1.9.3&lt;/code&gt;
To make a Ruby version default for the system use the command &lt;/span&gt;&lt;/li&gt;
&lt;li&gt;&lt;span style=&quot;font-size: small;&quot;&gt;&lt;code&gt;rvm alias create default 1.8.7&lt;/code&gt;&lt;/span&gt;&lt;/li&gt;
&lt;li&gt;&lt;span style=&quot;font-size: small;&quot;&gt;&lt;code&gt;rvm alias create default 1.8.7-p334&lt;/code&gt;&lt;/span&gt;&lt;/li&gt;
&lt;li&gt;
&lt;span style=&quot;font-size: small;&quot;&gt;&lt;code&gt;rvm alias create default 1.9.3&lt;/code&gt;&lt;/span&gt;
&lt;/li&gt;
&lt;/ul&gt;
&lt;div style=&quot;font-family: &amp;quot;Trebuchet MS&amp;quot;,sans-serif;&quot;&gt;
&lt;span style=&quot;font-size: small;&quot;&gt;This Ruby version will be the default version of Ruby on the 
system , to change to other versions of Ruby use the above mentioned 
commands.&lt;br /&gt;
To use default incase of switching use    &lt;/span&gt;&lt;/div&gt;
&lt;ul style=&quot;font-family: &amp;quot;Trebuchet MS&amp;quot;,sans-serif;&quot;&gt;
&lt;li&gt;&lt;span style=&quot;font-size: small;&quot;&gt;&lt;code&gt;rvm use default&lt;/code&gt;&lt;/span&gt;&lt;/li&gt;
&lt;/ul&gt;
&lt;div style=&quot;font-family: &amp;quot;Trebuchet MS&amp;quot;,sans-serif;&quot;&gt;
&lt;span style=&quot;font-size: small;&quot;&gt;To remove RVM from the system use the command &lt;/span&gt;&lt;/div&gt;
&lt;ul style=&quot;font-family: &amp;quot;Trebuchet MS&amp;quot;,sans-serif;&quot;&gt;
&lt;li&gt;&lt;span style=&quot;font-size: small;&quot;&gt;&lt;code&gt;rvm implode&lt;/code&gt;&lt;/span&gt;&lt;/li&gt;
&lt;/ul&gt;
&lt;/div&gt;
</content><link rel='replies' type='application/atom+xml' href='http://rorashish.blogspot.com/feeds/1477813065186913415/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://rorashish.blogspot.com/2012/06/installing-ruby-on-ubuntu.html#comment-form' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/2936127337406425108/posts/default/1477813065186913415'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/2936127337406425108/posts/default/1477813065186913415'/><link rel='alternate' type='text/html' href='http://rorashish.blogspot.com/2012/06/installing-ruby-on-ubuntu.html' title='Installing Ruby on Ubuntu'/><author><name>Anonymous</name><uri>http://www.blogger.com/profile/14643110071701140642</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='16' height='16' src='https://img1.blogblog.com/img/b16-rounded.gif'/></author><thr:total>0</thr:total><georss:featurename>Mumbai, Maharashtra, India</georss:featurename><georss:point>19.0759837 72.8776559</georss:point><georss:box>18.835877699999998 72.5617989 19.3160897 73.193512899999988</georss:box></entry><entry><id>tag:blogger.com,1999:blog-2936127337406425108.post-1691233396576605711</id><published>2012-06-13T19:49:00.000+05:30</published><updated>2012-06-13T19:49:33.651+05:30</updated><category scheme="http://www.blogger.com/atom/ns#" term="ruby"/><category scheme="http://www.blogger.com/atom/ns#" term="ruby 193"/><category scheme="http://www.blogger.com/atom/ns#" term="ruby install windows"/><category scheme="http://www.blogger.com/atom/ns#" term="ruby on rails install"/><category scheme="http://www.blogger.com/atom/ns#" term="ruby187"/><title type='text'>Installing Ruby on Windows</title><content type='html'>&lt;div dir=&quot;ltr&quot; style=&quot;text-align: left;&quot; trbidi=&quot;on&quot;&gt;
&lt;h3 style=&quot;font-family: &amp;quot;Trebuchet MS&amp;quot;,sans-serif;&quot;&gt;
&lt;span style=&quot;font-size: small;&quot;&gt;Step 1 :&lt;/span&gt;&lt;/h3&gt;
&lt;div style=&quot;font-family: &amp;quot;Trebuchet MS&amp;quot;,sans-serif;&quot;&gt;
&lt;span style=&quot;font-size: small;&quot;&gt;Download Ruby from &lt;a href=&quot;http://www.ruby-lang.org/en/&quot;&gt;http://www.ruby-lang.org/en/&lt;/a&gt;.  &lt;/span&gt;&lt;/div&gt;
&lt;hr style=&quot;font-family: &amp;quot;Trebuchet MS&amp;quot;,sans-serif;&quot; /&gt;
&lt;div style=&quot;font-family: &amp;quot;Trebuchet MS&amp;quot;,sans-serif;&quot;&gt;
&lt;span style=&quot;font-size: small;&quot;&gt;Versions Available : &lt;/span&gt;&lt;/div&gt;
&lt;ul style=&quot;font-family: &amp;quot;Trebuchet MS&amp;quot;,sans-serif;&quot;&gt;
&lt;li&gt; &lt;span style=&quot;font-size: small;&quot;&gt;&lt;code&gt;Ruby 1.8.6&lt;/code&gt;&lt;/span&gt;
&lt;/li&gt;
&lt;li&gt; &lt;span style=&quot;font-size: small;&quot;&gt;&lt;code&gt;Ruby 1.8.7&lt;/code&gt;&lt;/span&gt;
&lt;/li&gt;
&lt;li&gt; &lt;span style=&quot;font-size: small;&quot;&gt;&lt;code&gt;Ruby 1.9.1&lt;/code&gt;&lt;/span&gt;
&lt;/li&gt;
&lt;li&gt; &lt;span style=&quot;font-size: small;&quot;&gt;&lt;code&gt;Ruby 1.9.2&lt;/code&gt;&lt;/span&gt;
&lt;/li&gt;
&lt;li&gt; &lt;span style=&quot;font-size: small;&quot;&gt;&lt;code&gt;Ruby 1.9.3&lt;/code&gt; &lt;em&gt;*Recommended&lt;/em&gt;&lt;/span&gt;
&lt;/li&gt;
&lt;/ul&gt;
&lt;div style=&quot;font-family: &amp;quot;Trebuchet MS&amp;quot;,sans-serif;&quot;&gt;
&lt;span style=&quot;font-size: small;&quot;&gt;Run the installer to install Ruby like any other windows application.&lt;br /&gt;
After install verify the installation by opening the command prompt&lt;br /&gt;
( &lt;code&gt;Win Key + R&lt;/code&gt; : Type &lt;code&gt;CMD&lt;/code&gt; : Press Enter )  &lt;/span&gt;&lt;/div&gt;
&lt;div style=&quot;font-family: &amp;quot;Trebuchet MS&amp;quot;,sans-serif;&quot;&gt;
&lt;span style=&quot;font-size: small;&quot;&gt;Type   &lt;/span&gt;&lt;/div&gt;
&lt;ul style=&quot;font-family: &amp;quot;Trebuchet MS&amp;quot;,sans-serif;&quot;&gt;
&lt;li&gt;
&lt;span style=&quot;font-size: small;&quot;&gt;&lt;code&gt;ruby -v&lt;/code&gt;&lt;/span&gt;
&lt;/li&gt;
&lt;/ul&gt;
&lt;div style=&quot;font-family: &amp;quot;Trebuchet MS&amp;quot;,sans-serif;&quot;&gt;
&lt;span style=&quot;font-size: small;&quot;&gt;This should display the Ruby version which has been installed  &lt;/span&gt;&lt;/div&gt;
&lt;hr style=&quot;font-family: &amp;quot;Trebuchet MS&amp;quot;,sans-serif;&quot; /&gt;
&lt;h3 style=&quot;font-family: &amp;quot;Trebuchet MS&amp;quot;,sans-serif;&quot;&gt;
&lt;span style=&quot;font-size: small;&quot;&gt;Step 2&lt;/span&gt;&lt;/h3&gt;
&lt;div style=&quot;font-family: &amp;quot;Trebuchet MS&amp;quot;,sans-serif;&quot;&gt;
&lt;span style=&quot;font-size: small;&quot;&gt;Download Devkit from &lt;a href=&quot;http://rubyinstaller.org/downloads/archives/&quot;&gt;http://rubyinstaller.org/downloads/archives/&lt;/a&gt;&lt;/span&gt;&lt;/div&gt;
&lt;hr style=&quot;font-family: &amp;quot;Trebuchet MS&amp;quot;,sans-serif;&quot; /&gt;
&lt;div style=&quot;font-family: &amp;quot;Trebuchet MS&amp;quot;,sans-serif;&quot;&gt;
&lt;span style=&quot;font-size: small;&quot;&gt;Extract the Devkit in a directory.&lt;br /&gt;
  Open command prompt and navigate to the the directory where you extracted Devkit.&lt;br /&gt;
  Type &lt;/span&gt;&lt;/div&gt;
&lt;ul style=&quot;font-family: &amp;quot;Trebuchet MS&amp;quot;,sans-serif;&quot;&gt;
&lt;li&gt;
&lt;span style=&quot;font-size: small;&quot;&gt;&lt;code&gt;ruby dk.rb init&lt;/code&gt;&lt;/span&gt;
&lt;/li&gt;
&lt;li&gt;
&lt;span style=&quot;font-size: small;&quot;&gt;&lt;code&gt;ruby dk.rb install&lt;/code&gt;&lt;br /&gt;
Now Devkit is configured on your system.&lt;/span&gt;
&lt;/li&gt;
&lt;/ul&gt;
&lt;hr style=&quot;font-family: &amp;quot;Trebuchet MS&amp;quot;,sans-serif;&quot; /&gt;
&lt;h3 style=&quot;font-family: &amp;quot;Trebuchet MS&amp;quot;,sans-serif;&quot;&gt;
&lt;span style=&quot;font-size: small;&quot;&gt;Step 3&lt;/span&gt;&lt;/h3&gt;
&lt;div style=&quot;font-family: &amp;quot;Trebuchet MS&amp;quot;,sans-serif;&quot;&gt;
&lt;span style=&quot;font-size: small;&quot;&gt;Download Mysql/any other DB installer and install it on the machine to be used as a database for your Rails application&lt;/span&gt;&lt;/div&gt;
&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://rorashish.blogspot.com/feeds/1691233396576605711/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://rorashish.blogspot.com/2012/06/installing-ruby-on-windows.html#comment-form' title='1 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/2936127337406425108/posts/default/1691233396576605711'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/2936127337406425108/posts/default/1691233396576605711'/><link rel='alternate' type='text/html' href='http://rorashish.blogspot.com/2012/06/installing-ruby-on-windows.html' title='Installing Ruby on Windows'/><author><name>Anonymous</name><uri>http://www.blogger.com/profile/14643110071701140642</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='16' height='16' src='https://img1.blogblog.com/img/b16-rounded.gif'/></author><thr:total>1</thr:total><georss:featurename>Mumbai, Maharashtra, India</georss:featurename><georss:point>19.0759837 72.8776559</georss:point><georss:box>18.835877699999998 72.5617989 19.3160897 73.193512899999988</georss:box></entry><entry><id>tag:blogger.com,1999:blog-2936127337406425108.post-4181027188255362936</id><published>2012-06-13T19:45:00.001+05:30</published><updated>2012-06-13T19:47:34.852+05:30</updated><category scheme="http://www.blogger.com/atom/ns#" term="apple application"/><category scheme="http://www.blogger.com/atom/ns#" term="html5 native ios app"/><category scheme="http://www.blogger.com/atom/ns#" term="ios app"/><category scheme="http://www.blogger.com/atom/ns#" term="ios html phonegap app"/><category scheme="http://www.blogger.com/atom/ns#" term="ios native application"/><category scheme="http://www.blogger.com/atom/ns#" term="natiive ios app"/><category scheme="http://www.blogger.com/atom/ns#" term="Phonegap"/><title type='text'>Creating a native iOS application !</title><content type='html'>&lt;div dir=&quot;ltr&quot; style=&quot;text-align: left;&quot; trbidi=&quot;on&quot;&gt;
&lt;h3 style=&quot;font-family: Georgia,&amp;quot;Times New Roman&amp;quot;,serif;&quot;&gt;

&lt;span style=&quot;font-size: small;&quot;&gt;
Step 1 Installing XCode on the system&lt;/span&gt;&lt;/h3&gt;
&lt;ul style=&quot;font-family: Georgia,&amp;quot;Times New Roman&amp;quot;,serif; text-align: left;&quot;&gt;
&lt;li&gt;&lt;span style=&quot;font-size: small;&quot;&gt;Download and install &lt;code&gt;XCode&lt;/code&gt; from the App Center alongwith the &lt;code&gt;Developer Tools&lt;/code&gt;&lt;/span&gt;&lt;/li&gt;
&lt;/ul&gt;
&lt;h3 style=&quot;font-family: Georgia,&amp;quot;Times New Roman&amp;quot;,serif;&quot;&gt;

&lt;span style=&quot;font-size: small;&quot;&gt;
Step 2 Download the Phonegap SDK&lt;/span&gt;&lt;/h3&gt;
&lt;ul style=&quot;font-family: Georgia,&amp;quot;Times New Roman&amp;quot;,serif; text-align: left;&quot;&gt;
&lt;li&gt;&lt;span style=&quot;font-size: small;&quot;&gt;Download and unzip the Phonegap SDK.&lt;/span&gt;&lt;/li&gt;
&lt;li&gt;&lt;span style=&quot;font-size: small;&quot;&gt;Now navigate to the &lt;code&gt;iOS directory&lt;/code&gt; in the extracted source and run the &lt;code&gt;Cordova-1.7.0.dmg&lt;/code&gt; and install it.&lt;/span&gt;&lt;/li&gt;
&lt;/ul&gt;
&lt;h3 style=&quot;font-family: Georgia,&amp;quot;Times New Roman&amp;quot;,serif;&quot;&gt;

&lt;span style=&quot;font-size: small;&quot;&gt;
Step 3 Creating a XCode Project&lt;/span&gt;&lt;/h3&gt;
&lt;div style=&quot;font-family: Georgia,&amp;quot;Times New Roman&amp;quot;,serif;&quot;&gt;
&lt;span style=&quot;font-size: small;&quot;&gt;Run &lt;code&gt;XCode&lt;/code&gt; and create a new Project&lt;/span&gt;&lt;/div&gt;
&lt;div style=&quot;font-family: Georgia,&amp;quot;Times New Roman&amp;quot;,serif;&quot;&gt;
&lt;span style=&quot;font-size: small;&quot;&gt;Select the template &lt;/span&gt;&lt;/div&gt;
&lt;ul style=&quot;font-family: Georgia,&amp;quot;Times New Roman&amp;quot;,serif;&quot;&gt;
&lt;li&gt;&lt;span style=&quot;font-size: small;&quot;&gt;&lt;code&gt;Cordova-based Application&lt;/code&gt;&lt;/span&gt;&lt;/li&gt;
&lt;/ul&gt;
&lt;div style=&quot;font-family: Georgia,&amp;quot;Times New Roman&amp;quot;,serif;&quot;&gt;
&lt;span style=&quot;font-size: small;&quot;&gt;This will create the a new project and include the neccesary Phonegap API Files.&lt;/span&gt;&lt;/div&gt;
&lt;h3 style=&quot;font-family: Georgia,&amp;quot;Times New Roman&amp;quot;,serif;&quot;&gt;

&lt;span style=&quot;font-size: small;&quot;&gt;
Step 4 Changing the default compiler&lt;/span&gt;&lt;/h3&gt;
&lt;ul style=&quot;font-family: Georgia,&amp;quot;Times New Roman&amp;quot;,serif; text-align: left;&quot;&gt;
&lt;li&gt;&lt;span style=&quot;font-size: small;&quot;&gt;Click on the application name and select 
&lt;code&gt;BUILD SETTINGS&lt;/code&gt; 
tab in the center pane&lt;/span&gt;&lt;/li&gt;
&lt;li&gt;&lt;span style=&quot;font-size: small;&quot;&gt;Change the compiler in the 
&lt;code&gt;BUILD OPTIONS&lt;/code&gt; from 
&lt;code&gt;APPLE LLVM COMPILER&lt;/code&gt; 
to 
&lt;code&gt;LLVM GCC&lt;/code&gt;&lt;/span&gt;&lt;/li&gt;
&lt;/ul&gt;
&lt;h3 style=&quot;font-family: Georgia,&amp;quot;Times New Roman&amp;quot;,serif;&quot;&gt;

&lt;span style=&quot;font-size: small;&quot;&gt;
Step 5 Build and Run the Project&lt;/span&gt;&lt;/h3&gt;
&lt;ul style=&quot;font-family: Georgia,&amp;quot;Times New Roman&amp;quot;,serif; text-align: left;&quot;&gt;
&lt;li&gt;&lt;span style=&quot;font-size: small;&quot;&gt;Click on the left top of the XCode window selecting the default device as iPad/iPhone
Now run the Project.
This would invoke the simulator and run the application on it.&lt;/span&gt;&lt;/li&gt;
&lt;li&gt;&lt;span style=&quot;font-size: small;&quot;&gt;Once the application runs a error will Popup stating the &lt;code&gt;index.html&lt;/code&gt; is not found.
Close the simulator and return back to the XCode project window.&lt;/span&gt;&lt;/li&gt;
&lt;/ul&gt;
&lt;h3 style=&quot;font-family: Georgia,&amp;quot;Times New Roman&amp;quot;,serif;&quot;&gt;

&lt;span style=&quot;font-size: small;&quot;&gt;
Step 6 Include &lt;code&gt;www&lt;/code&gt; folder in the project to start with application development&lt;/span&gt;&lt;/h3&gt;
&lt;ul style=&quot;font-family: Georgia,&amp;quot;Times New Roman&amp;quot;,serif; text-align: left;&quot;&gt;
&lt;li&gt;&lt;span style=&quot;font-size: small;&quot;&gt;Right click the project name and select &lt;code&gt;Show in Finder&lt;/code&gt;&lt;/span&gt;&lt;/li&gt;
&lt;li&gt;&lt;span style=&quot;font-size: small;&quot;&gt;Drag the &lt;code&gt;www&lt;/code&gt; folder from the &lt;code&gt;Finder&lt;/code&gt; to the &lt;code&gt;Project&lt;/code&gt;&lt;/span&gt;&lt;/li&gt;
&lt;li&gt;&lt;span style=&quot;font-size: small;&quot;&gt;A window pop&#39;s up , select to create references to the files.&lt;/span&gt;&lt;/li&gt;
&lt;/ul&gt;
&lt;h3 style=&quot;font-family: Georgia,&amp;quot;Times New Roman&amp;quot;,serif;&quot;&gt;

&lt;span style=&quot;font-size: small;&quot;&gt;
Step 7 Again &lt;code&gt;BUILD &amp;amp; RUN&lt;/code&gt;&lt;/span&gt;
&lt;/h3&gt;
&lt;ul style=&quot;font-family: Georgia,&amp;quot;Times New Roman&amp;quot;,serif; text-align: left;&quot;&gt;
&lt;li&gt;&lt;span style=&quot;font-size: small;&quot;&gt;Now again build and run the project in an iPad/iPhone simulatore&lt;/span&gt;&lt;/li&gt;
&lt;li&gt;&lt;span style=&quot;font-size: small;&quot;&gt;This time it would show up the &lt;code&gt;index.html&lt;/code&gt; which is located in the &lt;code&gt;www&lt;/code&gt; folder.
Also it would show up the &lt;code&gt;Dialog&lt;/code&gt; stating that Phonegap was successfully integrated in the application&lt;/span&gt;&lt;/li&gt;
&lt;/ul&gt;
&lt;h3 style=&quot;font-family: Georgia,&amp;quot;Times New Roman&amp;quot;,serif;&quot;&gt;

&lt;span style=&quot;font-size: small;&quot;&gt;
Step 8 Download JQuery Mobile bundle&lt;/span&gt;&lt;/h3&gt;
&lt;div style=&quot;font-family: Georgia,&amp;quot;Times New Roman&amp;quot;,serif;&quot;&gt;
&lt;span style=&quot;font-size: small;&quot;&gt;Download the latest build of JQuery Mobile from  &lt;a href=&quot;http://jquerymobile.com/&quot;&gt;http://jquerymobile.com/&lt;/a&gt;
Unzip the contents and add the files in the &lt;code&gt;www&lt;/code&gt; folder categorizing the folders as &lt;/span&gt;&lt;/div&gt;
&lt;ul style=&quot;font-family: Georgia,&amp;quot;Times New Roman&amp;quot;,serif;&quot;&gt;
&lt;li&gt;&lt;span style=&quot;font-size: small;&quot;&gt;&lt;code&gt;javascripts&lt;/code&gt;&lt;/span&gt;&lt;/li&gt;
&lt;li&gt;&lt;span style=&quot;font-size: small;&quot;&gt;&lt;code&gt;stylesheets&lt;/code&gt;&lt;/span&gt;&lt;/li&gt;
&lt;li&gt;&lt;span style=&quot;font-size: small;&quot;&gt;`images&#39;&lt;/span&gt;&lt;/li&gt;
&lt;/ul&gt;
&lt;h3 style=&quot;font-family: Georgia,&amp;quot;Times New Roman&amp;quot;,serif;&quot;&gt;

&lt;span style=&quot;font-size: small;&quot;&gt;
Step 9 Including the JQuery mobile in the application&lt;/span&gt;&lt;/h3&gt;
&lt;ul style=&quot;font-family: Georgia,&amp;quot;Times New Roman&amp;quot;,serif; text-align: left;&quot;&gt;
&lt;li&gt;&lt;span style=&quot;font-size: small;&quot;&gt;Open &lt;code&gt;index.html&lt;/code&gt; and create references to the javascript and css files located in the &lt;code&gt;www&lt;/code&gt; folder using the html tags&lt;/span&gt;&lt;/li&gt;
&lt;/ul&gt;
&lt;h3 style=&quot;font-family: Georgia,&amp;quot;Times New Roman&amp;quot;,serif;&quot;&gt;

&lt;span style=&quot;font-size: small;&quot;&gt;
Step 10&lt;/span&gt;&lt;/h3&gt;
&lt;div style=&quot;font-family: Georgia,&amp;quot;Times New Roman&amp;quot;,serif;&quot;&gt;
&lt;span style=&quot;font-size: small;&quot;&gt;Add a few lines of HTML to the index page and use the JQuery classes 
and the Phonegap api function calls to implement the features of the 
native application as desired    &lt;/span&gt;&lt;/div&gt;
&lt;div style=&quot;font-family: Georgia,&amp;quot;Times New Roman&amp;quot;,serif;&quot;&gt;
&lt;span style=&quot;font-size: small;&quot;&gt;More Documentation available at   &lt;/span&gt;&lt;/div&gt;
&lt;ul style=&quot;font-family: Georgia,&amp;quot;Times New Roman&amp;quot;,serif;&quot;&gt;
&lt;li&gt;
&lt;span style=&quot;font-size: small;&quot;&gt;&lt;b&gt;JQuery Mobile&lt;/b&gt; &lt;a href=&quot;http://jquerymobile.com/demos/1.1.0/&quot;&gt;http://jquerymobile.com/demos/1.1.0/&lt;/a&gt;&lt;/span&gt;
&lt;/li&gt;
&lt;li&gt;
&lt;span style=&quot;font-size: small;&quot;&gt;&lt;b&gt;Phonegap&lt;/b&gt; &lt;a href=&quot;http://docs.phonegap.com/en/1.8.0/index.html&quot;&gt;http://docs.phonegap.com/en/1.8.0/index.html&lt;/a&gt;&lt;/span&gt;
&lt;/li&gt;
&lt;/ul&gt;
&lt;h3 style=&quot;font-family: Georgia,&amp;quot;Times New Roman&amp;quot;,serif;&quot;&gt;

&lt;span style=&quot;font-size: small;&quot;&gt;
Step 11 * not tested though&lt;/span&gt;&lt;/h3&gt;
&lt;ul style=&quot;font-family: Georgia,&amp;quot;Times New Roman&amp;quot;,serif; text-align: left;&quot;&gt;
&lt;li&gt;&lt;span style=&quot;font-size: small;&quot;&gt;Once the application is complete or for on Device testing a &lt;code&gt;Apple&#39;s Developer License&lt;/code&gt; is required to sign the applications.&lt;/span&gt;&lt;/li&gt;
&lt;li&gt;&lt;span style=&quot;font-size: small;&quot;&gt;After signing it , push the application to &lt;code&gt;PhoneGap Build&lt;/code&gt; &lt;a href=&quot;https://build.phonegap.com/&quot;&gt;https://build.phonegap.com/&lt;/a&gt;.&lt;/span&gt;&lt;/li&gt;
&lt;li&gt;&lt;span style=&quot;font-size: small;&quot;&gt;Download the build package and deploy to th Device.&lt;/span&gt;&lt;/li&gt;
&lt;/ul&gt;
&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://rorashish.blogspot.com/feeds/4181027188255362936/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://rorashish.blogspot.com/2012/06/creating-native-ios-application.html#comment-form' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/2936127337406425108/posts/default/4181027188255362936'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/2936127337406425108/posts/default/4181027188255362936'/><link rel='alternate' type='text/html' href='http://rorashish.blogspot.com/2012/06/creating-native-ios-application.html' title='Creating a native iOS application !'/><author><name>Anonymous</name><uri>http://www.blogger.com/profile/14643110071701140642</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='16' height='16' src='https://img1.blogblog.com/img/b16-rounded.gif'/></author><thr:total>0</thr:total><georss:featurename>Mumbai, Maharashtra, India</georss:featurename><georss:point>19.0759837 72.8776559</georss:point><georss:box>18.835877699999998 72.5617989 19.3160897 73.193512899999988</georss:box></entry><entry><id>tag:blogger.com,1999:blog-2936127337406425108.post-2695025223362642529</id><published>2012-02-11T16:32:00.000+05:30</published><updated>2012-02-11T17:51:09.706+05:30</updated><category scheme="http://www.blogger.com/atom/ns#" term="android emulator setu"/><category scheme="http://www.blogger.com/atom/ns#" term="android rhomobile setup"/><category scheme="http://www.blogger.com/atom/ns#" term="rails mobile"/><category scheme="http://www.blogger.com/atom/ns#" term="rails mobile app ubuntu"/><category scheme="http://www.blogger.com/atom/ns#" term="rails ubuntu mobile"/><category scheme="http://www.blogger.com/atom/ns#" term="rhodes gem"/><category scheme="http://www.blogger.com/atom/ns#" term="rhomobile"/><category scheme="http://www.blogger.com/atom/ns#" term="rhomobile android"/><category scheme="http://www.blogger.com/atom/ns#" term="ruby mobile"/><category scheme="http://www.blogger.com/atom/ns#" term="ubuntu mobile application"/><category scheme="http://www.blogger.com/atom/ns#" term="ubuntu rhomobile"/><title type='text'>Setting up RHODES with an Android Emulator</title><content type='html'>&lt;div dir=&quot;ltr&quot; style=&quot;text-align: left;&quot; trbidi=&quot;on&quot;&gt;
&lt;div style=&quot;font-family: &amp;quot;Trebuchet MS&amp;quot;,sans-serif;&quot;&gt;
&lt;span style=&quot;font-size: large;&quot;&gt;Setting up the system&lt;/span&gt;&lt;/div&gt;
&lt;div style=&quot;font-family: &amp;quot;Trebuchet MS&amp;quot;,sans-serif;&quot;&gt;
&lt;br /&gt;&lt;/div&gt;
&lt;div style=&quot;font-family: &amp;quot;Trebuchet MS&amp;quot;,sans-serif;&quot;&gt;
1. Installing Ruby. Please follow the sequence of commands given below to install ruby on ubuntu using RVM.&lt;/div&gt;
&lt;div style=&quot;background-color: #cccccc; color: black; font-family: &amp;quot;Trebuchet MS&amp;quot;,sans-serif;&quot;&gt;
&lt;br /&gt;&lt;/div&gt;
&lt;blockquote class=&quot;tr_bq&quot; style=&quot;background-color: #cccccc; color: black; font-family: &amp;quot;Trebuchet MS&amp;quot;,sans-serif;&quot;&gt;
$ sudo apt-get install git&lt;br /&gt;
$ sudo apt-get install curl&lt;br /&gt;
$ bash -s stable &amp;lt; &amp;lt;(curl -s https://raw.github.com/wayneeseguin/rvm/master/binscripts/rvm-installer)&lt;br /&gt;
$ rvm pkg install zlib&lt;br /&gt;
$ rvm pkg install openssl&lt;br /&gt;
$ rvm install ruby-1.8.7-p334&lt;br /&gt;
$ rvm alias create default ruby-1.8.7-p334&lt;/blockquote&gt;
&lt;div style=&quot;font-family: &amp;quot;Trebuchet MS&amp;quot;,sans-serif;&quot;&gt;
2. Download Android-sdk for linux&lt;/div&gt;
&lt;blockquote class=&quot;tr_bq&quot; style=&quot;background-color: #cccccc; font-family: &amp;quot;Trebuchet MS&amp;quot;,sans-serif;&quot;&gt;
&lt;a href=&quot;http://dl.google.com/android/android-sdk_r16-linux.tgz%20&quot; target=&quot;_blank&quot;&gt;Android SDK Download&lt;/a&gt;&lt;/blockquote&gt;
&lt;div style=&quot;font-family: &amp;quot;Trebuchet MS&amp;quot;,sans-serif;&quot;&gt;
3. Download Android-ndk for linux&lt;/div&gt;
&lt;blockquote class=&quot;tr_bq&quot; style=&quot;background-color: #cccccc; font-family: &amp;quot;Trebuchet MS&amp;quot;,sans-serif;&quot;&gt;
&lt;a href=&quot;http://dl.google.com/android/ndk/android-ndk-r7-linux-x86.tar.bz2&quot; target=&quot;_blank&quot;&gt;Android NDK Download&lt;/a&gt;&lt;/blockquote&gt;
&lt;div style=&quot;font-family: &amp;quot;Trebuchet MS&amp;quot;,sans-serif;&quot;&gt;
4. Extract both the zip files in two different folder&#39;s.&lt;/div&gt;
&lt;div style=&quot;font-family: &amp;quot;Trebuchet MS&amp;quot;,sans-serif;&quot;&gt;
&lt;br /&gt;&lt;/div&gt;
&lt;div style=&quot;font-family: &amp;quot;Trebuchet MS&amp;quot;,sans-serif;&quot;&gt;
5. Java is needed to be installed in the system.If not then download the Java SDK zip files from&lt;/div&gt;
&lt;blockquote class=&quot;tr_bq&quot; style=&quot;background-color: #cccccc; font-family: &amp;quot;Trebuchet MS&amp;quot;,sans-serif;&quot;&gt;
&lt;a href=&quot;http://www.oracle.com/technetwork/java/javase/downloads/jdk-7u2-download-1377129.html&quot; target=&quot;_blank&quot;&gt;Java SDK 7 Download&lt;/a&gt;&lt;/blockquote&gt;
&lt;div style=&quot;font-family: &amp;quot;Trebuchet MS&amp;quot;,sans-serif;&quot;&gt;
6. Open the terminal and install the rhodes gem.&lt;/div&gt;
&lt;blockquote class=&quot;tr_bq&quot; style=&quot;background-color: #cccccc; font-family: &amp;quot;Trebuchet MS&amp;quot;,sans-serif;&quot;&gt;
&amp;nbsp;gem install rhodes&amp;nbsp;&lt;/blockquote&gt;
&lt;div style=&quot;font-family: &amp;quot;Trebuchet MS&amp;quot;,sans-serif;&quot;&gt;
the installation of the gem will take time as the size of the gem is &amp;lt; 50 MB&lt;/div&gt;
&lt;div style=&quot;font-family: &amp;quot;Trebuchet MS&amp;quot;,sans-serif;&quot;&gt;
&lt;br /&gt;&lt;/div&gt;
&lt;div style=&quot;font-family: &amp;quot;Trebuchet MS&amp;quot;,sans-serif;&quot;&gt;
7. After the gem installation ,type&lt;/div&gt;
&lt;blockquote class=&quot;tr_bq&quot; style=&quot;background-color: #cccccc; font-family: &amp;quot;Trebuchet MS&amp;quot;,sans-serif;&quot;&gt;
$ rhodes-setup&lt;/blockquote&gt;
&lt;div style=&quot;font-family: &amp;quot;Trebuchet MS&amp;quot;,sans-serif;&quot;&gt;
&lt;br /&gt;&lt;/div&gt;
&lt;div style=&quot;font-family: &amp;quot;Trebuchet MS&amp;quot;,sans-serif;&quot;&gt;
at the terminal .The screen should come up something like this ..&lt;/div&gt;
&lt;div style=&quot;font-family: &amp;quot;Trebuchet MS&amp;quot;,sans-serif;&quot;&gt;
&lt;br /&gt;&lt;/div&gt;
&lt;div class=&quot;separator&quot; style=&quot;clear: both; font-family: &amp;quot;Trebuchet MS&amp;quot;,sans-serif; text-align: center;&quot;&gt;
&lt;a href=&quot;https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEgEEVAGQX_8Ta1cIbUKQrdk5b55drhMlBTkPceugcw-I2MtaN2qMhGF_XFSf_jeUz-woChhkFqIp7jRtO8Jth_gbtMdBqnkGqocTDK3T9y1WW0l8koXKcNuD1uH9Fm-qU73OewaFZUoU-c-/s1600/Screenshot+at+2012-02-11+16:28:15.png&quot; imageanchor=&quot;1&quot; style=&quot;margin-left: 1em; margin-right: 1em;&quot;&gt;&lt;img border=&quot;0&quot; height=&quot;175&quot; src=&quot;https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEgEEVAGQX_8Ta1cIbUKQrdk5b55drhMlBTkPceugcw-I2MtaN2qMhGF_XFSf_jeUz-woChhkFqIp7jRtO8Jth_gbtMdBqnkGqocTDK3T9y1WW0l8koXKcNuD1uH9Fm-qU73OewaFZUoU-c-/s400/Screenshot+at+2012-02-11+16:28:15.png&quot; width=&quot;400&quot; /&gt;&lt;/a&gt;&lt;/div&gt;
&lt;div style=&quot;font-family: &amp;quot;Trebuchet MS&amp;quot;,sans-serif;&quot;&gt;
&lt;br /&gt;&lt;/div&gt;
&lt;div style=&quot;font-family: &amp;quot;Trebuchet MS&amp;quot;,sans-serif;&quot;&gt;
Now type in the directories where you extracted the&lt;/div&gt;
&lt;blockquote class=&quot;tr_bq&quot; style=&quot;background-color: #cccccc; font-family: &amp;quot;Trebuchet MS&amp;quot;,sans-serif;&quot;&gt;
1.Java SDK&lt;br /&gt;
2.Android SDK&lt;br /&gt;
3.Android NDK&lt;/blockquote&gt;
&lt;div style=&quot;font-family: &amp;quot;Trebuchet MS&amp;quot;,sans-serif;&quot;&gt;
8. Setting up the environment is complete.&lt;/div&gt;
&lt;div style=&quot;font-family: &amp;quot;Trebuchet MS&amp;quot;,sans-serif;&quot;&gt;
&lt;br /&gt;&lt;/div&gt;
&lt;div style=&quot;font-family: &amp;quot;Trebuchet MS&amp;quot;,sans-serif;&quot;&gt;
&lt;span style=&quot;font-size: large;&quot;&gt;&lt;br /&gt;&lt;/span&gt;&lt;/div&gt;
&lt;div style=&quot;font-family: &amp;quot;Trebuchet MS&amp;quot;,sans-serif;&quot;&gt;
&lt;span style=&quot;font-size: large;&quot;&gt;Now we will generate a demo application using rhodes to test the emulator.&lt;/span&gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
1.Setting up Android SDK to host an emulator of a specific android version.&lt;br /&gt;
&lt;br /&gt;
2.Go to the directory where you extracted the sdk .Then go into the tools folder in the sdk and click on a file name &lt;b&gt;&quot;android&quot;&lt;/b&gt;.A window opens up :&lt;br /&gt;
&lt;br /&gt;
&lt;div class=&quot;separator&quot; style=&quot;clear: both; text-align: center;&quot;&gt;
&lt;/div&gt;
&lt;div class=&quot;separator&quot; style=&quot;clear: both; text-align: center;&quot;&gt;
&lt;a href=&quot;https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEjRzNSMihyzV8IUWkYAw8HKHn4NcSp7hCqZGhee6zS7tQSjQXVmageXNiX8nuYYYUzKB5LUJYGzuJ0F_2jZyJMHVYSPBnDkc96r6AsQo-0GIgSyWOtKeRPFvKSrwK2D9tbwAuKW-7LESu0J/s1600/Screenshot+at+2012-02-11+16:56:31.png&quot; imageanchor=&quot;1&quot; style=&quot;margin-left: 1em; margin-right: 1em;&quot;&gt;&lt;img border=&quot;0&quot; height=&quot;295&quot; src=&quot;https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEjRzNSMihyzV8IUWkYAw8HKHn4NcSp7hCqZGhee6zS7tQSjQXVmageXNiX8nuYYYUzKB5LUJYGzuJ0F_2jZyJMHVYSPBnDkc96r6AsQo-0GIgSyWOtKeRPFvKSrwK2D9tbwAuKW-7LESu0J/s400/Screenshot+at+2012-02-11+16:56:31.png&quot; width=&quot;400&quot; /&gt;&lt;/a&gt;&lt;/div&gt;
3. Click on the checkbox Android 3.0 , this selects all the checkboxes in this group.Now click on install wait for a few minutes.&lt;br /&gt;
&lt;br /&gt;
4. Now open your terminal and generate a new rhodes application.&lt;br /&gt;
&lt;blockquote class=&quot;tr_bq&quot;&gt;
&lt;div style=&quot;background-color: #cccccc;&quot;&gt;
rhogen app Demo &lt;/div&gt;
&lt;span style=&quot;background-color: #cccccc;&quot;&gt;cd Demo&lt;/span&gt;&lt;/blockquote&gt;
5. Edit the built.yml file in any text editor to change the android version to 3.0 instead of default 2.1 and add an emulator name.&lt;br /&gt;
&lt;div class=&quot;separator&quot; style=&quot;clear: both; text-align: center;&quot;&gt;
&lt;br /&gt;&lt;/div&gt;
&lt;div class=&quot;separator&quot; style=&quot;clear: both; text-align: center;&quot;&gt;
&lt;a href=&quot;https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEj-nXnQ2oRNtT41vscwmbX9yuH4kjnG_q4dqxvY2s95xhlqcByp7tTGY8DtrWSD63x-fstihaan7obYJ2uC9cbkVU3GkNRPZ1hESKnKOUllguO18WWOC0RbNE_ClCDQV_7i-nXXxze2ySlY/s1600/Screenshot+at+2012-02-11+17:04:06.png&quot; imageanchor=&quot;1&quot; style=&quot;margin-left: 1em; margin-right: 1em;&quot;&gt;&lt;img border=&quot;0&quot; height=&quot;318&quot; src=&quot;https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEj-nXnQ2oRNtT41vscwmbX9yuH4kjnG_q4dqxvY2s95xhlqcByp7tTGY8DtrWSD63x-fstihaan7obYJ2uC9cbkVU3GkNRPZ1hESKnKOUllguO18WWOC0RbNE_ClCDQV_7i-nXXxze2ySlY/s400/Screenshot+at+2012-02-11+17:04:06.png&quot; width=&quot;400&quot; /&gt;&amp;nbsp;&lt;/a&gt;&lt;/div&gt;
&lt;br /&gt;
&lt;div class=&quot;separator&quot; style=&quot;clear: both; text-align: center;&quot;&gt;
&lt;/div&gt;
6. Now go back to the terminal and type :&lt;br /&gt;
&lt;blockquote class=&quot;tr_bq&quot; style=&quot;background-color: #cccccc; color: black;&quot;&gt;
rake run:android&lt;/blockquote&gt;
7. The android emulator will show up in a few minutes and load the rhomobile application .&lt;br /&gt;
&lt;br /&gt;
&lt;div class=&quot;separator&quot; style=&quot;clear: both; text-align: center;&quot;&gt;
&lt;a href=&quot;https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEh1mPRORqupGMzsREKw3OGhecYWqgA2SsPqhyphenhyphen12f9UeAz_WCeyhoPDRUjto7HD7ut6NUjUHniZ1P4-M-lCNfiUOXsB0sUCHk7AzrUrjSzGSCf0MgVgyoC2wiA8Cggg6Y5vYtGwIzU82bH_B/s1600/Screenshot+at+2012-02-11+17:12:47.png&quot; imageanchor=&quot;1&quot; style=&quot;margin-left: 1em; margin-right: 1em;&quot;&gt;&lt;img border=&quot;0&quot; height=&quot;148&quot; src=&quot;https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEh1mPRORqupGMzsREKw3OGhecYWqgA2SsPqhyphenhyphen12f9UeAz_WCeyhoPDRUjto7HD7ut6NUjUHniZ1P4-M-lCNfiUOXsB0sUCHk7AzrUrjSzGSCf0MgVgyoC2wiA8Cggg6Y5vYtGwIzU82bH_B/s400/Screenshot+at+2012-02-11+17:12:47.png&quot; width=&quot;400&quot; /&gt;&lt;/a&gt;&lt;/div&gt;
&lt;br /&gt;
Now we can go forward designing the mobile application.Happy coding :)&lt;/div&gt;
&lt;div style=&quot;font-family: &amp;quot;Trebuchet MS&amp;quot;,sans-serif;&quot;&gt;
&lt;br /&gt;&lt;/div&gt;
&lt;div style=&quot;font-family: &amp;quot;Trebuchet MS&amp;quot;,sans-serif;&quot;&gt;
&lt;br /&gt;&lt;/div&gt;
&lt;div style=&quot;font-family: &amp;quot;Trebuchet MS&amp;quot;,sans-serif;&quot;&gt;
&lt;br /&gt;&lt;/div&gt;
&lt;/div&gt;
</content><link rel='replies' type='application/atom+xml' href='http://rorashish.blogspot.com/feeds/2695025223362642529/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://rorashish.blogspot.com/2012/02/setting-up-rhodes-with-android-emulator.html#comment-form' title='1 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/2936127337406425108/posts/default/2695025223362642529'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/2936127337406425108/posts/default/2695025223362642529'/><link rel='alternate' type='text/html' href='http://rorashish.blogspot.com/2012/02/setting-up-rhodes-with-android-emulator.html' title='Setting up RHODES with an Android Emulator'/><author><name>Anonymous</name><uri>http://www.blogger.com/profile/14643110071701140642</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='16' height='16' src='https://img1.blogblog.com/img/b16-rounded.gif'/></author><media:thumbnail xmlns:media="http://search.yahoo.com/mrss/" url="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEgEEVAGQX_8Ta1cIbUKQrdk5b55drhMlBTkPceugcw-I2MtaN2qMhGF_XFSf_jeUz-woChhkFqIp7jRtO8Jth_gbtMdBqnkGqocTDK3T9y1WW0l8koXKcNuD1uH9Fm-qU73OewaFZUoU-c-/s72-c/Screenshot+at+2012-02-11+16:28:15.png" height="72" width="72"/><thr:total>1</thr:total></entry><entry><id>tag:blogger.com,1999:blog-2936127337406425108.post-3583098434813380190</id><published>2011-11-30T01:58:00.001+05:30</published><updated>2011-11-30T02:32:54.241+05:30</updated><category scheme="http://www.blogger.com/atom/ns#" term="excel export rails"/><category scheme="http://www.blogger.com/atom/ns#" term="excel export rails 3"/><category scheme="http://www.blogger.com/atom/ns#" term="excel export ror"/><category scheme="http://www.blogger.com/atom/ns#" term="excel export ruby"/><category scheme="http://www.blogger.com/atom/ns#" term="xls export in ror"/><category scheme="http://www.blogger.com/atom/ns#" term="xls export in ruby"/><category scheme="http://www.blogger.com/atom/ns#" term="xls export rails"/><category scheme="http://www.blogger.com/atom/ns#" term="xls export rails 3"/><title type='text'>Export to Excel in Rails 3 without a Gem</title><content type='html'>&lt;div dir=&quot;ltr&quot; style=&quot;text-align: left;&quot; trbidi=&quot;on&quot;&gt;
&lt;h3 class=&quot;post-title entry-title&quot; style=&quot;font-family: &amp;quot;Courier New&amp;quot;,Courier,monospace;&quot;&gt;



Export to Excel in Rails 3 without a Gem&lt;/h3&gt;
&lt;div class=&quot;MsoNoSpacing&quot; style=&quot;font-family: &amp;quot;Courier New&amp;quot;,Courier,monospace;&quot;&gt;
&lt;/div&gt;
&lt;div class=&quot;MsoNoSpacing&quot; style=&quot;font-family: &amp;quot;Courier New&amp;quot;,Courier,monospace;&quot;&gt;
&lt;/div&gt;
&lt;span style=&quot;font-family: &amp;quot;Courier New&amp;quot;,Courier,monospace;&quot;&gt;
&lt;/span&gt;&lt;br /&gt;
&lt;h2 style=&quot;font-family: &amp;quot;Courier New&amp;quot;,Courier,monospace;&quot;&gt;







&lt;span style=&quot;font-size: medium;&quot;&gt;Creating Demo project&lt;/span&gt;&lt;/h2&gt;
&lt;blockquote class=&quot;tr_bq&quot; style=&quot;background-color: #cccccc; font-family: &amp;quot;Courier New&amp;quot;,Courier,monospace;&quot;&gt;
&lt;div class=&quot;MsoNormal&quot; style=&quot;line-height: normal; margin-bottom: .0001pt; margin-bottom: 0in; tab-stops: 45.8pt 91.6pt 137.4pt 183.2pt 229.0pt 274.8pt 320.6pt 366.4pt 412.2pt 458.0pt 503.8pt 549.6pt 595.4pt 641.2pt 687.0pt 732.8pt;&quot;&gt;
&lt;span style=&quot;font-size: 10pt;&quot;&gt;&amp;nbsp;rails new xcel_demo –d mysql&lt;/span&gt;&lt;/div&gt;
&lt;/blockquote&gt;
&lt;h2 style=&quot;font-family: &amp;quot;Courier New&amp;quot;,Courier,monospace;&quot;&gt;







&lt;span style=&quot;font-size: small;&quot;&gt;Creating a User model&lt;/span&gt;&lt;/h2&gt;
&lt;blockquote class=&quot;tr_bq&quot; style=&quot;background-color: #cccccc; font-family: &amp;quot;Courier New&amp;quot;,Courier,monospace;&quot;&gt;
&lt;div class=&quot;MsoNormal&quot; style=&quot;line-height: normal; margin-bottom: .0001pt; margin-bottom: 0in; tab-stops: 45.8pt 91.6pt 137.4pt 183.2pt 229.0pt 274.8pt 320.6pt 366.4pt 412.2pt 458.0pt 503.8pt 549.6pt 595.4pt 641.2pt 687.0pt 732.8pt;&quot;&gt;
&lt;span style=&quot;font-size: 10pt;&quot;&gt;rails g scaffold User name:string
email:string content:string&lt;/span&gt;&lt;/div&gt;
&lt;/blockquote&gt;
&lt;div class=&quot;MsoNormal&quot; style=&quot;font-family: &amp;quot;Courier New&amp;quot;,Courier,monospace; line-height: normal; margin-bottom: 0in;&quot;&gt;
&lt;/div&gt;
&lt;h2 style=&quot;font-family: &amp;quot;Courier New&amp;quot;,Courier,monospace;&quot;&gt;


&lt;span style=&quot;font-size: small;&quot;&gt;Add a MIME type in \config\initializers\mime_type.rb&lt;/span&gt;&lt;/h2&gt;
&lt;blockquote class=&quot;tr_bq&quot; style=&quot;background-color: #cccccc; font-family: &amp;quot;Courier New&amp;quot;,Courier,monospace;&quot;&gt;
&lt;div class=&quot;MsoNormal&quot; style=&quot;line-height: normal; margin-bottom: .0001pt; margin-bottom: 0in; tab-stops: 45.8pt 91.6pt 137.4pt 183.2pt 229.0pt 274.8pt 320.6pt 366.4pt 412.2pt 458.0pt 503.8pt 549.6pt 595.4pt 641.2pt 687.0pt 732.8pt;&quot;&gt;
&lt;span style=&quot;font-size: 10pt;&quot;&gt;Mime::Type.register &#39;application/vnd.ms-excel&#39;, :xls&lt;/span&gt;&lt;/div&gt;
&lt;/blockquote&gt;
&lt;h2 style=&quot;font-family: &amp;quot;Courier New&amp;quot;,Courier,monospace;&quot;&gt;


&lt;span style=&quot;font-size: small;&quot;&gt;Add a xls format output to the method in the Controller&lt;/span&gt;&lt;/h2&gt;
&lt;div class=&quot;MsoNormal&quot; style=&quot;font-family: &amp;quot;Courier New&amp;quot;,Courier,monospace; line-height: normal; margin-bottom: 0in;&quot;&gt;
&lt;/div&gt;
&lt;blockquote class=&quot;tr_bq&quot; style=&quot;background-color: #cccccc; font-family: &amp;quot;Courier New&amp;quot;,Courier,monospace;&quot;&gt;
&amp;nbsp;
def index&lt;br /&gt;
&amp;nbsp;&amp;nbsp;&amp;nbsp; @users = User.all&lt;br /&gt;
&lt;br /&gt;
&amp;nbsp;&amp;nbsp;&amp;nbsp; respond_to do |format|&lt;br /&gt;
&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; format.html # index.html.erb&lt;br /&gt;
&amp;nbsp;&amp;nbsp;&amp;nbsp; &amp;nbsp; format.xls&lt;br /&gt;
&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; format.xml&amp;nbsp; { render :xml =&amp;gt; @users }&lt;br /&gt;
&amp;nbsp;&amp;nbsp;&amp;nbsp; end&lt;br /&gt;
&amp;nbsp; end&lt;/blockquote&gt;
&lt;span style=&quot;background-color: #cccccc; font-family: &amp;quot;Courier New&amp;quot;,Courier,monospace;&quot;&gt;&lt;/span&gt;&lt;br /&gt;
&lt;h2 style=&quot;font-family: &amp;quot;Courier New&amp;quot;,Courier,monospace;&quot;&gt;


&lt;span style=&quot;font-size: small;&quot;&gt;




Creating the view for the XLS&lt;/span&gt;&lt;/h2&gt;
&lt;span style=&quot;font-family: &amp;quot;Courier New&amp;quot;,Courier,monospace;&quot;&gt;
&lt;/span&gt;
&lt;br /&gt;
&lt;div class=&quot;MsoNormal&quot; style=&quot;font-family: &amp;quot;Courier New&amp;quot;,Courier,monospace; line-height: normal; margin-bottom: 0in;&quot;&gt;
&lt;span style=&quot;font-size: 10pt;&quot;&gt;Now create a view to render the xls file. Here as we have modified the index method we will create a view index.xls.erb for the same in the views for Users&lt;/span&gt;&lt;/div&gt;
&lt;div class=&quot;MsoNormal&quot; style=&quot;font-family: &amp;quot;Courier New&amp;quot;,Courier,monospace; line-height: normal; margin-bottom: 0in;&quot;&gt;
&lt;/div&gt;
&lt;blockquote class=&quot;tr_bq&quot; style=&quot;background-color: #cccccc; font-family: &amp;quot;Courier New&amp;quot;,Courier,monospace;&quot;&gt;
&amp;lt;h1&amp;gt;Listing users&amp;lt;/h1&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;table&amp;gt;&lt;br /&gt;
&amp;nbsp; &amp;lt;tr&amp;gt;&lt;br /&gt;
&amp;nbsp;&amp;nbsp;&amp;nbsp; &amp;lt;th&amp;gt;Name&amp;lt;/th&amp;gt;&lt;br /&gt;
&amp;nbsp;&amp;nbsp;&amp;nbsp; &amp;lt;th&amp;gt;City&amp;lt;/th&amp;gt;&lt;br /&gt;
&amp;nbsp;&amp;nbsp;&amp;nbsp; &amp;lt;th&amp;gt;Gender&amp;lt;/th&amp;gt;&lt;br /&gt;
&amp;nbsp;&amp;nbsp;&amp;nbsp; &amp;lt;th&amp;gt;Phone&amp;lt;/th&amp;gt;&lt;br /&gt;
&amp;nbsp;&amp;nbsp;&amp;nbsp; &amp;lt;th&amp;gt;Address&amp;lt;/th&amp;gt;&lt;br /&gt;
&amp;nbsp;&amp;nbsp;&amp;nbsp; &amp;lt;th&amp;gt;&amp;lt;/th&amp;gt;&lt;br /&gt;
&amp;nbsp;&amp;nbsp;&amp;nbsp; &amp;lt;th&amp;gt;&amp;lt;/th&amp;gt;&lt;br /&gt;
&amp;nbsp;&amp;nbsp;&amp;nbsp; &amp;lt;th&amp;gt;&amp;lt;/th&amp;gt;&lt;br /&gt;
&amp;nbsp; &amp;lt;/tr&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;% @users.each do |user| %&amp;gt;&lt;br /&gt;
&amp;nbsp; &amp;lt;tr&amp;gt;&lt;br /&gt;
&amp;nbsp;&amp;nbsp;&amp;nbsp; &amp;lt;td&amp;gt;&amp;lt;%= user.name %&amp;gt;&amp;lt;/td&amp;gt;&lt;br /&gt;
&amp;nbsp;&amp;nbsp;&amp;nbsp; &amp;lt;td&amp;gt;&amp;lt;%= user.city %&amp;gt;&amp;lt;/td&amp;gt;&lt;br /&gt;
&amp;nbsp;&amp;nbsp;&amp;nbsp; &amp;lt;td&amp;gt;&amp;lt;%= user.gender %&amp;gt;&amp;lt;/td&amp;gt;&lt;br /&gt;
&amp;nbsp;&amp;nbsp;&amp;nbsp; &amp;lt;td&amp;gt;&amp;lt;%= user.phone %&amp;gt;&amp;lt;/td&amp;gt;&lt;br /&gt;
&amp;nbsp;&amp;nbsp;&amp;nbsp; &amp;lt;td&amp;gt;&amp;lt;%= user.address %&amp;gt;&amp;lt;/td&amp;gt;&lt;br /&gt;
&amp;nbsp; &amp;lt;/tr&amp;gt;&lt;br /&gt;
&amp;lt;% end %&amp;gt;&lt;br /&gt;
&amp;lt;/table&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;br /&amp;gt;&lt;/blockquote&gt;
&lt;div class=&quot;MsoNormal&quot; style=&quot;font-family: &amp;quot;Courier New&amp;quot;,Courier,monospace; line-height: normal; margin-bottom: 0in;&quot;&gt;
The text in the &amp;lt;th&amp;gt; tags are the headers and &amp;lt;td&amp;gt; tags are the data for the specified columns&lt;/div&gt;
&lt;h2 style=&quot;font-family: &amp;quot;Courier New&amp;quot;,Courier,monospace;&quot;&gt;







&lt;span style=&quot;font-size: small;&quot;&gt;Adding the link to export excel on the Index page&lt;/span&gt;&lt;/h2&gt;
&lt;span style=&quot;font-family: &amp;quot;Courier New&amp;quot;,Courier,monospace;&quot;&gt;
&lt;/span&gt;&lt;br /&gt;
&lt;div class=&quot;MsoNormal&quot; style=&quot;font-family: &amp;quot;Courier New&amp;quot;,Courier,monospace; line-height: normal; margin-bottom: 0in;&quot;&gt;
&lt;/div&gt;
&lt;blockquote class=&quot;tr_bq&quot; style=&quot;background-color: #cccccc; font-family: &amp;quot;Courier New&amp;quot;,Courier,monospace;&quot;&gt;
&amp;nbsp;&amp;lt;%= link_to &#39;Export XLS&#39;, url_for(:format =&amp;gt; &#39;xls&#39;) %&amp;gt;&lt;/blockquote&gt;
&lt;div style=&quot;font-family: &amp;quot;Courier New&amp;quot;,Courier,monospace;&quot;&gt;
&lt;/div&gt;
&lt;div style=&quot;font-family: &amp;quot;Courier New&amp;quot;,Courier,monospace;&quot;&gt;
&lt;/div&gt;
&lt;div style=&quot;font-family: &amp;quot;Courier New&amp;quot;,Courier,monospace;&quot;&gt;
This will allow the data on index page to be exported in Excel Format.&lt;/div&gt;
&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://rorashish.blogspot.com/feeds/3583098434813380190/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://rorashish.blogspot.com/2011/11/export-to-excel-in-rails-3-without-gem.html#comment-form' title='23 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/2936127337406425108/posts/default/3583098434813380190'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/2936127337406425108/posts/default/3583098434813380190'/><link rel='alternate' type='text/html' href='http://rorashish.blogspot.com/2011/11/export-to-excel-in-rails-3-without-gem.html' title='Export to Excel in Rails 3 without a Gem'/><author><name>Anonymous</name><uri>http://www.blogger.com/profile/14643110071701140642</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='16' height='16' src='https://img1.blogblog.com/img/b16-rounded.gif'/></author><thr:total>23</thr:total></entry><entry><id>tag:blogger.com,1999:blog-2936127337406425108.post-5681595530889355470</id><published>2011-11-11T01:26:00.001+05:30</published><updated>2011-11-11T01:45:45.697+05:30</updated><category scheme="http://www.blogger.com/atom/ns#" term="actionmailer"/><category scheme="http://www.blogger.com/atom/ns#" term="email in ruby"/><category scheme="http://www.blogger.com/atom/ns#" term="email rails"/><category scheme="http://www.blogger.com/atom/ns#" term="emails"/><category scheme="http://www.blogger.com/atom/ns#" term="gmail email in ruby"/><category scheme="http://www.blogger.com/atom/ns#" term="html email in ror"/><title type='text'>Action Mailer for Rails 3</title><content type='html'>&lt;div dir=&quot;ltr&quot; style=&quot;text-align: left;&quot; trbidi=&quot;on&quot;&gt;
Action Mailer allows you to send email from your application using a mailer
model and views.&lt;br /&gt;
&lt;a name=&#39;more&#39;&gt;&lt;/a&gt;&lt;br /&gt;
&lt;div class=&quot;MsoNoSpacing&quot;&gt;
This tutorial is
about how to send an email using gmail free service in Ruby on Rails 3 and above&lt;/div&gt;
&lt;div class=&quot;MsoNoSpacing&quot;&gt;
&lt;br /&gt;&lt;/div&gt;
&lt;h2&gt;




&lt;span style=&quot;font-size: large;&quot;&gt;Creating Demo project&lt;/span&gt;&lt;/h2&gt;
&lt;blockquote class=&quot;tr_bq&quot; style=&quot;background-color: #cccccc; font-family: &amp;quot;Trebuchet MS&amp;quot;,sans-serif;&quot;&gt;
&lt;div class=&quot;MsoNormal&quot; style=&quot;line-height: normal; margin-bottom: .0001pt; margin-bottom: 0in; tab-stops: 45.8pt 91.6pt 137.4pt 183.2pt 229.0pt 274.8pt 320.6pt 366.4pt 412.2pt 458.0pt 503.8pt 549.6pt 595.4pt 641.2pt 687.0pt 732.8pt;&quot;&gt;
&lt;span style=&quot;font-size: 10pt;&quot;&gt;&amp;nbsp;rails new mail_demo –d mysql&lt;/span&gt;&lt;/div&gt;
&lt;/blockquote&gt;
&lt;h2&gt;




Creating a User model&lt;/h2&gt;
&lt;blockquote class=&quot;tr_bq&quot; style=&quot;background-color: #cccccc; font-family: &amp;quot;Trebuchet MS&amp;quot;,sans-serif;&quot;&gt;
&lt;div class=&quot;MsoNormal&quot; style=&quot;line-height: normal; margin-bottom: .0001pt; margin-bottom: 0in; tab-stops: 45.8pt 91.6pt 137.4pt 183.2pt 229.0pt 274.8pt 320.6pt 366.4pt 412.2pt 458.0pt 503.8pt 549.6pt 595.4pt 641.2pt 687.0pt 732.8pt;&quot;&gt;
&lt;span style=&quot;font-size: 10pt;&quot;&gt;rails g scaffold User name:string
email:string content:string&lt;/span&gt;&lt;/div&gt;
&lt;/blockquote&gt;
&lt;div class=&quot;MsoNormal&quot; style=&quot;line-height: normal; margin-bottom: .0001pt; margin-bottom: 0in; tab-stops: 45.8pt 91.6pt 137.4pt 183.2pt 229.0pt 274.8pt 320.6pt 366.4pt 412.2pt 458.0pt 503.8pt 549.6pt 595.4pt 641.2pt 687.0pt 732.8pt;&quot;&gt;
&lt;br /&gt;&lt;/div&gt;
&lt;h2&gt;




Creating a Mailer model&lt;/h2&gt;
&lt;blockquote class=&quot;tr_bq&quot; style=&quot;background-color: #cccccc; font-family: &amp;quot;Trebuchet MS&amp;quot;,sans-serif;&quot;&gt;
&lt;div class=&quot;MsoNormal&quot; style=&quot;line-height: normal; margin-bottom: .0001pt; margin-bottom: 0in; tab-stops: 45.8pt 91.6pt 137.4pt 183.2pt 229.0pt 274.8pt 320.6pt 366.4pt 412.2pt 458.0pt 503.8pt 549.6pt 595.4pt 641.2pt 687.0pt 732.8pt;&quot;&gt;
&lt;span style=&quot;font-size: 10pt;&quot;&gt;rails g mailer user_mailer&lt;/span&gt;&lt;/div&gt;
&lt;/blockquote&gt;
&lt;h2&gt;




&amp;nbsp;&lt;/h2&gt;
&lt;h2&gt;




Setting up the development.rb for configuring application settings to
access mail smtp server&lt;/h2&gt;
&lt;h3 style=&quot;font-weight: normal;&quot;&gt;




In development.rb&lt;/h3&gt;
&lt;div class=&quot;MsoNormal&quot; style=&quot;line-height: normal; margin-bottom: .0001pt; margin-bottom: 0in; tab-stops: 45.8pt 91.6pt 137.4pt 183.2pt 229.0pt 274.8pt 320.6pt 366.4pt 412.2pt 458.0pt 503.8pt 549.6pt 595.4pt 641.2pt 687.0pt 732.8pt;&quot;&gt;
&lt;br /&gt;&lt;/div&gt;
&lt;blockquote class=&quot;tr_bq&quot; style=&quot;background-color: #cccccc; font-family: &amp;quot;Trebuchet MS&amp;quot;,sans-serif;&quot;&gt;
&amp;nbsp; config.action_mailer.delivery_method = :smtp&lt;br /&gt;
# Defaults to:&lt;br /&gt;
&amp;nbsp;config.action_mailer.smtp_settings =&amp;nbsp; {&lt;br /&gt;
&amp;nbsp; :enable_starttls_auto =&amp;gt; true,&lt;br /&gt;
&amp;nbsp; :address&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; =&amp;gt; &#39;smtp.gmail.com&#39;,&lt;br /&gt;
&amp;nbsp; :port&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; =&amp;gt; 587,&lt;br /&gt;
&amp;nbsp; :domain&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; =&amp;gt; &#39;your.domain.com&#39;,&lt;br /&gt;
&amp;nbsp; :authentication =&amp;gt; :login,&lt;br /&gt;
&amp;nbsp; :content_type&amp;nbsp;&amp;nbsp; =&amp;gt; &quot;text/html&quot;,&lt;br /&gt;
&amp;nbsp; :user_name&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; =&amp;gt; &#39;username&#39;,&lt;br /&gt;
&amp;nbsp; :password&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; =&amp;gt; &#39;password&#39;&lt;br /&gt;
}&lt;br /&gt;
&lt;br /&gt;
config.action_mailer.perform_deliveries = true&lt;br /&gt;
config.action_mailer.raise_delivery_errors = true&lt;/blockquote&gt;
&lt;span style=&quot;background-color: #cccccc;&quot;&gt;

&lt;/span&gt;&lt;br /&gt;
&lt;div class=&quot;MsoNormal&quot; style=&quot;line-height: normal; margin-bottom: .0001pt; margin-bottom: 0in; tab-stops: 45.8pt 91.6pt 137.4pt 183.2pt 229.0pt 274.8pt 320.6pt 366.4pt 412.2pt 458.0pt 503.8pt 549.6pt 595.4pt 641.2pt 687.0pt 732.8pt;&quot;&gt;
&lt;br /&gt;&lt;/div&gt;
&lt;div class=&quot;MsoNormal&quot; style=&quot;line-height: normal; margin-bottom: .0001pt; margin-bottom: 0in; tab-stops: 45.8pt 91.6pt 137.4pt 183.2pt 229.0pt 274.8pt 320.6pt 366.4pt 412.2pt 458.0pt 503.8pt 549.6pt 595.4pt 641.2pt 687.0pt 732.8pt;&quot;&gt;
&lt;br /&gt;&lt;/div&gt;
&lt;div class=&quot;MsoNormal&quot; style=&quot;line-height: normal; margin-bottom: .0001pt; margin-bottom: 0in; tab-stops: 45.8pt 91.6pt 137.4pt 183.2pt 229.0pt 274.8pt 320.6pt 366.4pt 412.2pt 458.0pt 503.8pt 549.6pt 595.4pt 641.2pt 687.0pt 732.8pt;&quot;&gt;
&lt;span style=&quot;font-family: &amp;quot;Courier New&amp;quot;; font-size: 10pt;&quot;&gt;Remember
these are the basic settings needed to send mails from gmail ,other server may
have different settings .&lt;/span&gt;&lt;/div&gt;
&lt;h2&gt;




&amp;nbsp;&lt;/h2&gt;
&lt;h2&gt;




Creating the mailer&lt;/h2&gt;
&lt;br /&gt;
&lt;div class=&quot;MsoNormal&quot; style=&quot;line-height: normal; margin-bottom: .0001pt; margin-bottom: 0in; tab-stops: 45.8pt 91.6pt 137.4pt 183.2pt 229.0pt 274.8pt 320.6pt 366.4pt 412.2pt 458.0pt 503.8pt 549.6pt 595.4pt 641.2pt 687.0pt 732.8pt;&quot;&gt;
&lt;span style=&quot;font-family: &amp;quot;Courier New&amp;quot;; font-size: 10pt;&quot;&gt;Now
we will write the method in user_mailer model to send the mail .Remember in the
mailer model&lt;/span&gt;&lt;/div&gt;
&lt;div class=&quot;MsoNormal&quot; style=&quot;line-height: normal; margin-bottom: .0001pt; margin-bottom: 0in; tab-stops: 45.8pt 91.6pt 137.4pt 183.2pt 229.0pt 274.8pt 320.6pt 366.4pt 412.2pt 458.0pt 503.8pt 549.6pt 595.4pt 641.2pt 687.0pt 732.8pt;&quot;&gt;
&lt;br /&gt;&lt;/div&gt;
&lt;blockquote class=&quot;tr_bq&quot; style=&quot;background-color: #cccccc; font-family: &amp;quot;Trebuchet MS&amp;quot;,sans-serif;&quot;&gt;
&lt;div class=&quot;MsoNormal&quot; style=&quot;line-height: normal; margin-bottom: .0001pt; margin-bottom: 0in; tab-stops: 45.8pt 91.6pt 137.4pt 183.2pt 229.0pt 274.8pt 320.6pt 366.4pt 412.2pt 458.0pt 503.8pt 549.6pt 595.4pt 641.2pt 687.0pt 732.8pt;&quot;&gt;
&lt;span style=&quot;font-size: 10pt;&quot;&gt;def send_email(user)&lt;/span&gt;&lt;/div&gt;
&lt;div class=&quot;MsoNormal&quot; style=&quot;line-height: normal; margin-bottom: .0001pt; margin-bottom: 0in; tab-stops: 45.8pt 91.6pt 137.4pt 183.2pt 229.0pt 274.8pt 320.6pt 366.4pt 412.2pt 458.0pt 503.8pt 549.6pt 595.4pt 641.2pt 687.0pt 732.8pt;&quot;&gt;
&lt;span style=&quot;font-size: 10pt;&quot;&gt;&amp;nbsp;&amp;nbsp; recipients&amp;nbsp;
user.email&lt;/span&gt;&lt;/div&gt;
&lt;div class=&quot;MsoNormal&quot; style=&quot;line-height: normal; margin-bottom: .0001pt; margin-bottom: 0in; tab-stops: 45.8pt 91.6pt 137.4pt 183.2pt 229.0pt 274.8pt 320.6pt 366.4pt 412.2pt 458.0pt 503.8pt 549.6pt 595.4pt 641.2pt 687.0pt 732.8pt;&quot;&gt;
&lt;span style=&quot;font-size: 10pt;&quot;&gt;&amp;nbsp;&amp;nbsp; from&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;
&quot;webmaster@example.com&quot;&lt;/span&gt;&lt;/div&gt;
&lt;div class=&quot;MsoNormal&quot; style=&quot;line-height: normal; margin-bottom: .0001pt; margin-bottom: 0in; tab-stops: 45.8pt 91.6pt 137.4pt 183.2pt 229.0pt 274.8pt 320.6pt 366.4pt 412.2pt 458.0pt 503.8pt 549.6pt 595.4pt 641.2pt 687.0pt 732.8pt;&quot;&gt;
&lt;span style=&quot;font-size: 10pt;&quot;&gt;&amp;nbsp;&amp;nbsp; subject&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;
&quot;Thank you for Registering&quot;&lt;/span&gt;&lt;/div&gt;
&lt;div class=&quot;MsoNormal&quot; style=&quot;line-height: normal; margin-bottom: .0001pt; margin-bottom: 0in; tab-stops: 45.8pt 91.6pt 137.4pt 183.2pt 229.0pt 274.8pt 320.6pt 366.4pt 412.2pt 458.0pt 503.8pt 549.6pt 595.4pt 641.2pt 687.0pt 732.8pt;&quot;&gt;
&lt;span style=&quot;font-size: 10pt;&quot;&gt;&amp;nbsp;&amp;nbsp; part :content_type =&amp;gt;
&quot;text/html&quot;,&lt;/span&gt;&lt;/div&gt;
&lt;div class=&quot;MsoNormal&quot; style=&quot;line-height: normal; margin-bottom: .0001pt; margin-bottom: 0in; tab-stops: 45.8pt 91.6pt 137.4pt 183.2pt 229.0pt 274.8pt 320.6pt 366.4pt 412.2pt 458.0pt 503.8pt 549.6pt 595.4pt 641.2pt 687.0pt 732.8pt;&quot;&gt;
&lt;span style=&quot;font-size: 10pt;&quot;&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; :body =&amp;gt;
render_message(&quot;registration_confirmation&quot;, :user =&amp;gt; user)&lt;/span&gt;&lt;/div&gt;
&lt;div class=&quot;MsoNormal&quot; style=&quot;line-height: normal; margin-bottom: .0001pt; margin-bottom: 0in; tab-stops: 45.8pt 91.6pt 137.4pt 183.2pt 229.0pt 274.8pt 320.6pt 366.4pt 412.2pt 458.0pt 503.8pt 549.6pt 595.4pt 641.2pt 687.0pt 732.8pt;&quot;&gt;
&lt;span style=&quot;font-size: 10pt;&quot;&gt;end&lt;/span&gt;&lt;/div&gt;
&lt;/blockquote&gt;
&lt;div class=&quot;MsoNormal&quot; style=&quot;line-height: normal; margin-bottom: .0001pt; margin-bottom: 0in; tab-stops: 45.8pt 91.6pt 137.4pt 183.2pt 229.0pt 274.8pt 320.6pt 366.4pt 412.2pt 458.0pt 503.8pt 549.6pt 595.4pt 641.2pt 687.0pt 732.8pt;&quot;&gt;
&lt;br /&gt;&lt;/div&gt;
&lt;div class=&quot;MsoNormal&quot; style=&quot;line-height: normal; margin-bottom: .0001pt; margin-bottom: 0in; tab-stops: 45.8pt 91.6pt 137.4pt 183.2pt 229.0pt 274.8pt 320.6pt 366.4pt 412.2pt 458.0pt 503.8pt 549.6pt 595.4pt 641.2pt 687.0pt 732.8pt;&quot;&gt;
&lt;span style=&quot;font-family: &amp;quot;Courier New&amp;quot;; font-size: 10pt;&quot;&gt;The
from field can be your own or your domains email address. Please check if the
from for field has invalid email the user will not be able to reply .&lt;/span&gt;&lt;/div&gt;
&lt;div class=&quot;MsoNormal&quot; style=&quot;line-height: normal; margin-bottom: .0001pt; margin-bottom: 0in; tab-stops: 45.8pt 91.6pt 137.4pt 183.2pt 229.0pt 274.8pt 320.6pt 366.4pt 412.2pt 458.0pt 503.8pt 549.6pt 595.4pt 641.2pt 687.0pt 732.8pt;&quot;&gt;
&lt;br /&gt;&lt;/div&gt;
&lt;h2&gt;




Creating Email Template&lt;/h2&gt;
&lt;div class=&quot;MsoNormal&quot; style=&quot;line-height: normal; margin-bottom: .0001pt; margin-bottom: 0in; tab-stops: 45.8pt 91.6pt 137.4pt 183.2pt 229.0pt 274.8pt 320.6pt 366.4pt 412.2pt 458.0pt 503.8pt 549.6pt 595.4pt 641.2pt 687.0pt 732.8pt;&quot;&gt;
&lt;span style=&quot;font-family: &amp;quot;Courier New&amp;quot;; font-size: 10pt;&quot;&gt;Now
we will create a view which would form a the email template .It is named as
same as the method in the model user_mailer ie. Send_email.html.erb&lt;/span&gt;&lt;/div&gt;
&lt;div class=&quot;MsoNormal&quot; style=&quot;line-height: normal; margin-bottom: .0001pt; margin-bottom: 0in; tab-stops: 45.8pt 91.6pt 137.4pt 183.2pt 229.0pt 274.8pt 320.6pt 366.4pt 412.2pt 458.0pt 503.8pt 549.6pt 595.4pt 641.2pt 687.0pt 732.8pt;&quot;&gt;
&lt;br /&gt;&lt;/div&gt;
&lt;div class=&quot;MsoNormal&quot; style=&quot;line-height: normal; margin-bottom: .0001pt; margin-bottom: 0in; tab-stops: 45.8pt 91.6pt 137.4pt 183.2pt 229.0pt 274.8pt 320.6pt 366.4pt 412.2pt 458.0pt 503.8pt 549.6pt 595.4pt 641.2pt 687.0pt 732.8pt;&quot;&gt;
&lt;br /&gt;&lt;/div&gt;
&lt;blockquote class=&quot;tr_bq&quot; style=&quot;background-color: #cccccc; font-family: &amp;quot;Trebuchet MS&amp;quot;,sans-serif;&quot;&gt;
&lt;div class=&quot;MsoNormal&quot; style=&quot;line-height: normal; margin-bottom: .0001pt; margin-bottom: 0in; tab-stops: 45.8pt 91.6pt 137.4pt 183.2pt 229.0pt 274.8pt 320.6pt 366.4pt 412.2pt 458.0pt 503.8pt 549.6pt 595.4pt 641.2pt 687.0pt 732.8pt;&quot;&gt;
&lt;span style=&quot;font-size: 10pt;&quot;&gt;&amp;lt;!DOCTYPE
html PUBLIC &quot;-//W3C//DTD HTML 4.01 Transitional//EN&quot;&lt;/span&gt;&lt;/div&gt;
&lt;div class=&quot;MsoNormal&quot; style=&quot;line-height: normal; margin-bottom: .0001pt; margin-bottom: 0in; tab-stops: 45.8pt 91.6pt 137.4pt 183.2pt 229.0pt 274.8pt 320.6pt 366.4pt 412.2pt 458.0pt 503.8pt 549.6pt 595.4pt 641.2pt 687.0pt 732.8pt;&quot;&gt;
&lt;span style=&quot;font-size: 10pt;&quot;&gt;&amp;nbsp;
&quot;http://www.w3.org/TR/html4/loose.dtd&quot;&amp;gt;&lt;/span&gt;&lt;/div&gt;
&lt;div class=&quot;MsoNormal&quot; style=&quot;line-height: normal; margin-bottom: .0001pt; margin-bottom: 0in; tab-stops: 45.8pt 91.6pt 137.4pt 183.2pt 229.0pt 274.8pt 320.6pt 366.4pt 412.2pt 458.0pt 503.8pt 549.6pt 595.4pt 641.2pt 687.0pt 732.8pt;&quot;&gt;
&lt;br /&gt;&lt;/div&gt;
&lt;div class=&quot;MsoNormal&quot; style=&quot;line-height: normal; margin-bottom: .0001pt; margin-bottom: 0in; tab-stops: 45.8pt 91.6pt 137.4pt 183.2pt 229.0pt 274.8pt 320.6pt 366.4pt 412.2pt 458.0pt 503.8pt 549.6pt 595.4pt 641.2pt 687.0pt 732.8pt;&quot;&gt;
&lt;span style=&quot;font-size: 10pt;&quot;&gt;&amp;lt;html
lang=&quot;en&quot;&amp;gt;&lt;/span&gt;&lt;/div&gt;
&lt;div class=&quot;MsoNormal&quot; style=&quot;line-height: normal; margin-bottom: .0001pt; margin-bottom: 0in; tab-stops: 45.8pt 91.6pt 137.4pt 183.2pt 229.0pt 274.8pt 320.6pt 366.4pt 412.2pt 458.0pt 503.8pt 549.6pt 595.4pt 641.2pt 687.0pt 732.8pt;&quot;&gt;
&lt;span style=&quot;font-size: 10pt;&quot;&gt;&amp;nbsp; &amp;lt;head&amp;gt;&lt;/span&gt;&lt;/div&gt;
&lt;div class=&quot;MsoNormal&quot; style=&quot;line-height: normal; margin-bottom: .0001pt; margin-bottom: 0in; tab-stops: 45.8pt 91.6pt 137.4pt 183.2pt 229.0pt 274.8pt 320.6pt 366.4pt 412.2pt 458.0pt 503.8pt 549.6pt 595.4pt 641.2pt 687.0pt 732.8pt;&quot;&gt;
&lt;span style=&quot;font-size: 10pt;&quot;&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; &amp;lt;meta
http-equiv=&quot;Content-Type&quot; content=&quot;text/html;
charset=utf-8&quot;&amp;gt;&lt;/span&gt;&lt;/div&gt;
&lt;div class=&quot;MsoNormal&quot; style=&quot;line-height: normal; margin-bottom: .0001pt; margin-bottom: 0in; tab-stops: 45.8pt 91.6pt 137.4pt 183.2pt 229.0pt 274.8pt 320.6pt 366.4pt 412.2pt 458.0pt 503.8pt 549.6pt 595.4pt 641.2pt 687.0pt 732.8pt;&quot;&gt;
&lt;span style=&quot;font-size: 10pt;&quot;&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; &amp;lt;style type=&quot;text/css&quot;
media=&quot;screen&quot;&amp;gt;&lt;/span&gt;&lt;/div&gt;
&lt;div class=&quot;MsoNormal&quot; style=&quot;line-height: normal; margin-bottom: .0001pt; margin-bottom: 0in; tab-stops: 45.8pt 91.6pt 137.4pt 183.2pt 229.0pt 274.8pt 320.6pt 366.4pt 412.2pt 458.0pt 503.8pt 549.6pt 595.4pt 641.2pt 687.0pt 732.8pt;&quot;&gt;
&lt;span style=&quot;font-size: 10pt;&quot;&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; h3 { color: #f00; }&lt;/span&gt;&lt;/div&gt;
&lt;div class=&quot;MsoNormal&quot; style=&quot;line-height: normal; margin-bottom: .0001pt; margin-bottom: 0in; tab-stops: 45.8pt 91.6pt 137.4pt 183.2pt 229.0pt 274.8pt 320.6pt 366.4pt 412.2pt 458.0pt 503.8pt 549.6pt 595.4pt 641.2pt 687.0pt 732.8pt;&quot;&gt;
&lt;span style=&quot;font-size: 10pt;&quot;&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; ul { list-style: none; }&lt;/span&gt;&lt;/div&gt;
&lt;div class=&quot;MsoNormal&quot; style=&quot;line-height: normal; margin-bottom: .0001pt; margin-bottom: 0in; tab-stops: 45.8pt 91.6pt 137.4pt 183.2pt 229.0pt 274.8pt 320.6pt 366.4pt 412.2pt 458.0pt 503.8pt 549.6pt 595.4pt 641.2pt 687.0pt 732.8pt;&quot;&gt;
&lt;span style=&quot;font-size: 10pt;&quot;&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; &amp;lt;/style&amp;gt;&lt;/span&gt;&lt;/div&gt;
&lt;div class=&quot;MsoNormal&quot; style=&quot;line-height: normal; margin-bottom: .0001pt; margin-bottom: 0in; tab-stops: 45.8pt 91.6pt 137.4pt 183.2pt 229.0pt 274.8pt 320.6pt 366.4pt 412.2pt 458.0pt 503.8pt 549.6pt 595.4pt 641.2pt 687.0pt 732.8pt;&quot;&gt;
&lt;span style=&quot;font-size: 10pt;&quot;&gt;&amp;nbsp; &amp;lt;/head&amp;gt;&lt;/span&gt;&lt;/div&gt;
&lt;div class=&quot;MsoNormal&quot; style=&quot;line-height: normal; margin-bottom: .0001pt; margin-bottom: 0in; tab-stops: 45.8pt 91.6pt 137.4pt 183.2pt 229.0pt 274.8pt 320.6pt 366.4pt 412.2pt 458.0pt 503.8pt 549.6pt 595.4pt 641.2pt 687.0pt 732.8pt;&quot;&gt;
&lt;span style=&quot;font-size: 10pt;&quot;&gt;&amp;nbsp; &amp;lt;body&amp;gt;&lt;/span&gt;&lt;/div&gt;
&lt;div class=&quot;MsoNormal&quot; style=&quot;line-height: normal; margin-bottom: .0001pt; margin-bottom: 0in; tab-stops: 45.8pt 91.6pt 137.4pt 183.2pt 229.0pt 274.8pt 320.6pt 366.4pt 412.2pt 458.0pt 503.8pt 549.6pt 595.4pt 641.2pt 687.0pt 732.8pt;&quot;&gt;
&lt;span style=&quot;font-size: 10pt;&quot;&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; &amp;lt;div&amp;gt;&lt;/span&gt;&lt;/div&gt;
&lt;div class=&quot;MsoNormal&quot; style=&quot;line-height: normal; margin-bottom: .0001pt; margin-bottom: 0in; tab-stops: 45.8pt 91.6pt 137.4pt 183.2pt 229.0pt 274.8pt 320.6pt 366.4pt 412.2pt 458.0pt 503.8pt 549.6pt 595.4pt 641.2pt 687.0pt 732.8pt;&quot;&gt;
&lt;span style=&quot;font-size: 10pt;&quot;&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; &amp;lt;h2 id = &quot;banner&quot;&amp;gt;Your
account signup details are below&amp;lt;/h2&amp;gt;&lt;/span&gt;&lt;/div&gt;
&lt;div class=&quot;MsoNormal&quot; style=&quot;line-height: normal; margin-bottom: .0001pt; margin-bottom: 0in; tab-stops: 45.8pt 91.6pt 137.4pt 183.2pt 229.0pt 274.8pt 320.6pt 366.4pt 412.2pt 458.0pt 503.8pt 549.6pt 595.4pt 641.2pt 687.0pt 732.8pt;&quot;&gt;
&lt;span style=&quot;font-size: 10pt;&quot;&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; &amp;lt;/div&amp;gt;&lt;/span&gt;&lt;/div&gt;
&lt;div class=&quot;MsoNormal&quot; style=&quot;line-height: normal; margin-bottom: .0001pt; margin-bottom: 0in; tab-stops: 45.8pt 91.6pt 137.4pt 183.2pt 229.0pt 274.8pt 320.6pt 366.4pt 412.2pt 458.0pt 503.8pt 549.6pt 595.4pt 641.2pt 687.0pt 732.8pt;&quot;&gt;
&lt;br /&gt;&lt;/div&gt;
&lt;div class=&quot;MsoNormal&quot; style=&quot;line-height: normal; margin-bottom: .0001pt; margin-bottom: 0in; tab-stops: 45.8pt 91.6pt 137.4pt 183.2pt 229.0pt 274.8pt 320.6pt 366.4pt 412.2pt 458.0pt 503.8pt 549.6pt 595.4pt 641.2pt 687.0pt 732.8pt;&quot;&gt;
&lt;span style=&quot;font-size: 10pt;&quot;&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; &amp;lt;ul&amp;gt;&amp;lt;br /&amp;gt;&amp;lt;br /&amp;gt;&lt;/span&gt;&lt;/div&gt;
&lt;div class=&quot;MsoNormal&quot; style=&quot;line-height: normal; margin-bottom: .0001pt; margin-bottom: 0in; tab-stops: 45.8pt 91.6pt 137.4pt 183.2pt 229.0pt 274.8pt 320.6pt 366.4pt 412.2pt 458.0pt 503.8pt 549.6pt 595.4pt 641.2pt 687.0pt 732.8pt;&quot;&gt;
&lt;span style=&quot;font-size: 10pt;&quot;&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; &amp;lt;li&amp;gt;&amp;lt;h2&amp;gt;Name: &amp;lt;b&amp;gt;&amp;lt;%=
@user.name %&amp;gt;&amp;lt;/b&amp;gt; &amp;lt;/h2&amp;gt;&amp;lt;/li&amp;gt;&lt;/span&gt;&lt;/div&gt;
&lt;div class=&quot;MsoNormal&quot; style=&quot;line-height: normal; margin-bottom: .0001pt; margin-bottom: 0in; tab-stops: 45.8pt 91.6pt 137.4pt 183.2pt 229.0pt 274.8pt 320.6pt 366.4pt 412.2pt 458.0pt 503.8pt 549.6pt 595.4pt 641.2pt 687.0pt 732.8pt;&quot;&gt;
&lt;br /&gt;&lt;/div&gt;
&lt;div class=&quot;MsoNormal&quot; style=&quot;line-height: normal; margin-bottom: .0001pt; margin-bottom: 0in; tab-stops: 45.8pt 91.6pt 137.4pt 183.2pt 229.0pt 274.8pt 320.6pt 366.4pt 412.2pt 458.0pt 503.8pt 549.6pt 595.4pt 641.2pt 687.0pt 732.8pt;&quot;&gt;
&lt;span style=&quot;font-size: 10pt;&quot;&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; &amp;lt;li&amp;gt;Login: &amp;lt;%= @user.email
%&amp;gt;&amp;lt;/li&amp;gt;&amp;lt;br /&amp;gt;&amp;lt;br /&amp;gt;&lt;/span&gt;&lt;/div&gt;
&lt;div class=&quot;MsoNormal&quot; style=&quot;line-height: normal; margin-bottom: .0001pt; margin-bottom: 0in; tab-stops: 45.8pt 91.6pt 137.4pt 183.2pt 229.0pt 274.8pt 320.6pt 366.4pt 412.2pt 458.0pt 503.8pt 549.6pt 595.4pt 641.2pt 687.0pt 732.8pt;&quot;&gt;
&lt;br /&gt;&lt;/div&gt;
&lt;div class=&quot;MsoNormal&quot; style=&quot;line-height: normal; margin-bottom: .0001pt; margin-bottom: 0in; tab-stops: 45.8pt 91.6pt 137.4pt 183.2pt 229.0pt 274.8pt 320.6pt 366.4pt 412.2pt 458.0pt 503.8pt 549.6pt 595.4pt 641.2pt 687.0pt 732.8pt;&quot;&gt;
&lt;span style=&quot;font-size: 10pt;&quot;&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; &amp;lt;li&amp;gt;Image: &amp;lt;%= image_tag
&#39;rails.png&#39; %&amp;gt;&amp;lt;/li&amp;gt;&amp;lt;br /&amp;gt;&amp;lt;br /&amp;gt;&lt;/span&gt;&lt;/div&gt;
&lt;div class=&quot;MsoNormal&quot; style=&quot;line-height: normal; margin-bottom: .0001pt; margin-bottom: 0in; tab-stops: 45.8pt 91.6pt 137.4pt 183.2pt 229.0pt 274.8pt 320.6pt 366.4pt 412.2pt 458.0pt 503.8pt 549.6pt 595.4pt 641.2pt 687.0pt 732.8pt;&quot;&gt;
&lt;br /&gt;&lt;/div&gt;
&lt;div class=&quot;MsoNormal&quot; style=&quot;line-height: normal; margin-bottom: .0001pt; margin-bottom: 0in; tab-stops: 45.8pt 91.6pt 137.4pt 183.2pt 229.0pt 274.8pt 320.6pt 366.4pt 412.2pt 458.0pt 503.8pt 549.6pt 595.4pt 641.2pt 687.0pt 732.8pt;&quot;&gt;
&lt;span style=&quot;font-size: 10pt;&quot;&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; &amp;lt;li&amp;gt;Content: &amp;lt;%= @user.content
%&amp;gt;&amp;lt;/li&amp;gt;&lt;/span&gt;&lt;/div&gt;
&lt;div class=&quot;MsoNormal&quot; style=&quot;line-height: normal; margin-bottom: .0001pt; margin-bottom: 0in; tab-stops: 45.8pt 91.6pt 137.4pt 183.2pt 229.0pt 274.8pt 320.6pt 366.4pt 412.2pt 458.0pt 503.8pt 549.6pt 595.4pt 641.2pt 687.0pt 732.8pt;&quot;&gt;
&lt;span style=&quot;font-size: 10pt;&quot;&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; &amp;lt;/ul&amp;gt;&lt;/span&gt;&lt;/div&gt;
&lt;div class=&quot;MsoNormal&quot; style=&quot;line-height: normal; margin-bottom: .0001pt; margin-bottom: 0in; tab-stops: 45.8pt 91.6pt 137.4pt 183.2pt 229.0pt 274.8pt 320.6pt 366.4pt 412.2pt 458.0pt 503.8pt 549.6pt 595.4pt 641.2pt 687.0pt 732.8pt;&quot;&gt;
&lt;span style=&quot;font-size: 10pt;&quot;&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; &lt;/span&gt;&lt;/div&gt;
&lt;div class=&quot;MsoNormal&quot; style=&quot;line-height: normal; margin-bottom: .0001pt; margin-bottom: 0in; tab-stops: 45.8pt 91.6pt 137.4pt 183.2pt 229.0pt 274.8pt 320.6pt 366.4pt 412.2pt 458.0pt 503.8pt 549.6pt 595.4pt 641.2pt 687.0pt 732.8pt;&quot;&gt;
&lt;span style=&quot;font-size: 10pt;&quot;&gt;&amp;nbsp; &amp;lt;/body&amp;gt;&lt;/span&gt;&lt;/div&gt;
&lt;div class=&quot;MsoNormal&quot; style=&quot;line-height: normal; margin-bottom: .0001pt; margin-bottom: 0in; tab-stops: 45.8pt 91.6pt 137.4pt 183.2pt 229.0pt 274.8pt 320.6pt 366.4pt 412.2pt 458.0pt 503.8pt 549.6pt 595.4pt 641.2pt 687.0pt 732.8pt;&quot;&gt;
&lt;span style=&quot;font-size: 10pt;&quot;&gt;&amp;lt;/html&amp;gt;&lt;/span&gt;&lt;/div&gt;
&lt;/blockquote&gt;
&lt;div class=&quot;MsoNormal&quot; style=&quot;line-height: normal; margin-bottom: .0001pt; margin-bottom: 0in; tab-stops: 45.8pt 91.6pt 137.4pt 183.2pt 229.0pt 274.8pt 320.6pt 366.4pt 412.2pt 458.0pt 503.8pt 549.6pt 595.4pt 641.2pt 687.0pt 732.8pt;&quot;&gt;
&lt;br /&gt;&lt;/div&gt;
&lt;div class=&quot;MsoNormal&quot; style=&quot;line-height: normal; margin-bottom: .0001pt; margin-bottom: 0in; tab-stops: 45.8pt 91.6pt 137.4pt 183.2pt 229.0pt 274.8pt 320.6pt 366.4pt 412.2pt 458.0pt 503.8pt 549.6pt 595.4pt 641.2pt 687.0pt 732.8pt;&quot;&gt;
&lt;span style=&quot;font-family: &amp;quot;Courier New&amp;quot;; font-size: 10pt;&quot;&gt;In
the end add a line to the create method of the Users_controller&lt;/span&gt;&lt;/div&gt;
&lt;div class=&quot;MsoNormal&quot; style=&quot;line-height: normal; margin-bottom: .0001pt; margin-bottom: 0in; tab-stops: 45.8pt 91.6pt 137.4pt 183.2pt 229.0pt 274.8pt 320.6pt 366.4pt 412.2pt 458.0pt 503.8pt 549.6pt 595.4pt 641.2pt 687.0pt 732.8pt;&quot;&gt;
&lt;br /&gt;&lt;/div&gt;
&lt;blockquote class=&quot;tr_bq&quot; style=&quot;background-color: #cccccc; font-family: &amp;quot;Trebuchet MS&amp;quot;,sans-serif;&quot;&gt;
&lt;div class=&quot;MsoNormal&quot; style=&quot;line-height: normal; margin-bottom: .0001pt; margin-bottom: 0in; tab-stops: 45.8pt 91.6pt 137.4pt 183.2pt 229.0pt 274.8pt 320.6pt 366.4pt 412.2pt 458.0pt 503.8pt 549.6pt 595.4pt 641.2pt 687.0pt 732.8pt;&quot;&gt;
&lt;span style=&quot;font-size: 10pt;&quot;&gt;&amp;nbsp;UserMailer.send_email(@user).deliver&lt;/span&gt;&lt;/div&gt;
&lt;/blockquote&gt;
&lt;div class=&quot;MsoNormal&quot; style=&quot;line-height: normal; margin-bottom: .0001pt; margin-bottom: 0in; tab-stops: 45.8pt 91.6pt 137.4pt 183.2pt 229.0pt 274.8pt 320.6pt 366.4pt 412.2pt 458.0pt 503.8pt 549.6pt 595.4pt 641.2pt 687.0pt 732.8pt;&quot;&gt;
&lt;br /&gt;&lt;/div&gt;
&lt;div class=&quot;MsoNormal&quot; style=&quot;line-height: normal; margin-bottom: .0001pt; margin-bottom: 0in; tab-stops: 45.8pt 91.6pt 137.4pt 183.2pt 229.0pt 274.8pt 320.6pt 366.4pt 412.2pt 458.0pt 503.8pt 549.6pt 595.4pt 641.2pt 687.0pt 732.8pt;&quot;&gt;
&lt;span style=&quot;font-family: &amp;quot;Courier New&amp;quot;; font-size: 10pt;&quot;&gt;The
method is referred to as deliver_send_email because rails appends it to a
mailer method.&lt;/span&gt;&lt;/div&gt;
&lt;div class=&quot;MsoNormal&quot; style=&quot;line-height: normal; margin-bottom: .0001pt; margin-bottom: 0in; tab-stops: 45.8pt 91.6pt 137.4pt 183.2pt 229.0pt 274.8pt 320.6pt 366.4pt 412.2pt 458.0pt 503.8pt 549.6pt 595.4pt 641.2pt 687.0pt 732.8pt;&quot;&gt;
&lt;br /&gt;&lt;/div&gt;
&lt;div class=&quot;MsoNormal&quot; style=&quot;line-height: normal; margin-bottom: .0001pt; margin-bottom: 0in; tab-stops: 45.8pt 91.6pt 137.4pt 183.2pt 229.0pt 274.8pt 320.6pt 366.4pt 412.2pt 458.0pt 503.8pt 549.6pt 595.4pt 641.2pt 687.0pt 732.8pt;&quot;&gt;
&lt;span style=&quot;font-family: &amp;quot;Courier New&amp;quot;; font-size: 10pt;&quot;&gt;Now
run the server and try creating a new user . The email is sent to the address
the user enters for the new record.&lt;/span&gt;&lt;/div&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://rorashish.blogspot.com/feeds/5681595530889355470/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://rorashish.blogspot.com/2011/11/action-mailer-for-rails-3.html#comment-form' title='3 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/2936127337406425108/posts/default/5681595530889355470'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/2936127337406425108/posts/default/5681595530889355470'/><link rel='alternate' type='text/html' href='http://rorashish.blogspot.com/2011/11/action-mailer-for-rails-3.html' title='Action Mailer for Rails 3'/><author><name>Anonymous</name><uri>http://www.blogger.com/profile/14643110071701140642</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='16' height='16' src='https://img1.blogblog.com/img/b16-rounded.gif'/></author><thr:total>3</thr:total></entry><entry><id>tag:blogger.com,1999:blog-2936127337406425108.post-2024220746965492417</id><published>2011-11-06T19:09:00.000+05:30</published><updated>2011-11-11T01:35:14.772+05:30</updated><category scheme="http://www.blogger.com/atom/ns#" term="actionmailer"/><category scheme="http://www.blogger.com/atom/ns#" term="actionmailer 2.3.9"/><category scheme="http://www.blogger.com/atom/ns#" term="email in ruby"/><category scheme="http://www.blogger.com/atom/ns#" term="email rails"/><category scheme="http://www.blogger.com/atom/ns#" term="emails"/><category scheme="http://www.blogger.com/atom/ns#" term="gmail email in ruby"/><category scheme="http://www.blogger.com/atom/ns#" term="html email in ror"/><category scheme="http://www.blogger.com/atom/ns#" term="rails email"/><category scheme="http://www.blogger.com/atom/ns#" term="ruby"/><category scheme="http://www.blogger.com/atom/ns#" term="ruby email"/><category scheme="http://www.blogger.com/atom/ns#" term="ruby gmail actionmailer"/><category scheme="http://www.blogger.com/atom/ns#" term="send email"/><title type='text'>Action Mailer 2.3.9 — Easy email delivery and testing</title><content type='html'>&lt;div dir=&quot;ltr&quot; style=&quot;text-align: left;&quot; trbidi=&quot;on&quot;&gt;
Action Mailer allows you to send email from your application using a mailer
model and views.&lt;br /&gt;
&lt;a name=&#39;more&#39;&gt;&lt;/a&gt;&lt;br /&gt;
&lt;div class=&quot;MsoNormal&quot; style=&quot;line-height: normal; mso-margin-bottom-alt: auto; mso-margin-top-alt: auto; mso-outline-level: 1;&quot;&gt;
&lt;b&gt;&lt;span style=&quot;font-family: &amp;quot;Times New Roman&amp;quot;,&amp;quot;serif&amp;quot;; font-size: 24pt;&quot;&gt;&lt;/span&gt;&lt;/b&gt;&lt;/div&gt;
&lt;div class=&quot;MsoNoSpacing&quot;&gt;
This tutorial is
about how to send an email using gmail free service in Ruby on Rails 2.3.9, for
versions higher than this refer rails guides .&lt;/div&gt;
&lt;div class=&quot;MsoNoSpacing&quot;&gt;
&lt;br /&gt;&lt;/div&gt;
&lt;h2&gt;




&lt;span style=&quot;font-size: large;&quot;&gt;Creating Demo project&lt;/span&gt;&lt;/h2&gt;
&lt;blockquote class=&quot;tr_bq&quot; style=&quot;background-color: #cccccc; font-family: &amp;quot;Trebuchet MS&amp;quot;,sans-serif;&quot;&gt;
&lt;div class=&quot;MsoNormal&quot; style=&quot;line-height: normal; margin-bottom: .0001pt; margin-bottom: 0in; tab-stops: 45.8pt 91.6pt 137.4pt 183.2pt 229.0pt 274.8pt 320.6pt 366.4pt 412.2pt 458.0pt 503.8pt 549.6pt 595.4pt 641.2pt 687.0pt 732.8pt;&quot;&gt;
&lt;span style=&quot;font-size: 10pt;&quot;&gt;&amp;nbsp;rails mail_demo –d mysql&lt;/span&gt;&lt;/div&gt;
&lt;/blockquote&gt;
&lt;h2&gt;




Creating a User model&lt;/h2&gt;
&lt;blockquote class=&quot;tr_bq&quot; style=&quot;background-color: #cccccc; font-family: &amp;quot;Trebuchet MS&amp;quot;,sans-serif;&quot;&gt;
&lt;div class=&quot;MsoNormal&quot; style=&quot;line-height: normal; margin-bottom: .0001pt; margin-bottom: 0in; tab-stops: 45.8pt 91.6pt 137.4pt 183.2pt 229.0pt 274.8pt 320.6pt 366.4pt 412.2pt 458.0pt 503.8pt 549.6pt 595.4pt 641.2pt 687.0pt 732.8pt;&quot;&gt;
&lt;span style=&quot;font-size: 10pt;&quot;&gt;&amp;nbsp;Ruby script/generate scaffold User name:string
email:string content:string&lt;/span&gt;&lt;/div&gt;
&lt;/blockquote&gt;
&lt;div class=&quot;MsoNormal&quot; style=&quot;line-height: normal; margin-bottom: .0001pt; margin-bottom: 0in; tab-stops: 45.8pt 91.6pt 137.4pt 183.2pt 229.0pt 274.8pt 320.6pt 366.4pt 412.2pt 458.0pt 503.8pt 549.6pt 595.4pt 641.2pt 687.0pt 732.8pt;&quot;&gt;
&lt;br /&gt;&lt;/div&gt;
&lt;h2&gt;




Creating a Mailer model&lt;/h2&gt;
&lt;blockquote class=&quot;tr_bq&quot; style=&quot;background-color: #cccccc; font-family: &amp;quot;Trebuchet MS&amp;quot;,sans-serif;&quot;&gt;
&lt;div class=&quot;MsoNormal&quot; style=&quot;line-height: normal; margin-bottom: .0001pt; margin-bottom: 0in; tab-stops: 45.8pt 91.6pt 137.4pt 183.2pt 229.0pt 274.8pt 320.6pt 366.4pt 412.2pt 458.0pt 503.8pt 549.6pt 595.4pt 641.2pt 687.0pt 732.8pt;&quot;&gt;
&lt;span style=&quot;font-size: 10pt;&quot;&gt;&amp;nbsp;Ruby script/generate mailer user_mailer&lt;/span&gt;&lt;/div&gt;
&lt;/blockquote&gt;
&lt;h2&gt;




&amp;nbsp;&lt;/h2&gt;
&lt;h2&gt;




Setting up the development.rb for configuring application settings to
access mail smtp server&lt;/h2&gt;
&lt;h3 style=&quot;font-weight: normal;&quot;&gt;




In development.rb&lt;/h3&gt;
&lt;div class=&quot;MsoNormal&quot; style=&quot;line-height: normal; margin-bottom: .0001pt; margin-bottom: 0in; tab-stops: 45.8pt 91.6pt 137.4pt 183.2pt 229.0pt 274.8pt 320.6pt 366.4pt 412.2pt 458.0pt 503.8pt 549.6pt 595.4pt 641.2pt 687.0pt 732.8pt;&quot;&gt;
&lt;br /&gt;&lt;/div&gt;
&lt;blockquote class=&quot;tr_bq&quot; style=&quot;background-color: #cccccc; font-family: &amp;quot;Trebuchet MS&amp;quot;,sans-serif;&quot;&gt;
&lt;div class=&quot;MsoNormal&quot; style=&quot;line-height: normal; margin-bottom: .0001pt; margin-bottom: 0in; tab-stops: 45.8pt 91.6pt 137.4pt 183.2pt 229.0pt 274.8pt 320.6pt 366.4pt 412.2pt 458.0pt 503.8pt 549.6pt 595.4pt 641.2pt 687.0pt 732.8pt;&quot;&gt;
&lt;span style=&quot;font-size: 10pt;&quot;&gt;config.action_mailer.delivery_method
= :smtp&lt;/span&gt;&lt;/div&gt;
&lt;div class=&quot;MsoNormal&quot; style=&quot;line-height: normal; margin-bottom: .0001pt; margin-bottom: 0in; tab-stops: 45.8pt 91.6pt 137.4pt 183.2pt 229.0pt 274.8pt 320.6pt 366.4pt 412.2pt 458.0pt 503.8pt 549.6pt 595.4pt 641.2pt 687.0pt 732.8pt;&quot;&gt;
&lt;span style=&quot;font-size: 10pt;&quot;&gt;config.action_mailer.raise_delivery_errors
= true&lt;/span&gt;&lt;/div&gt;
&lt;div class=&quot;MsoNormal&quot; style=&quot;line-height: normal; margin-bottom: .0001pt; margin-bottom: 0in; tab-stops: 45.8pt 91.6pt 137.4pt 183.2pt 229.0pt 274.8pt 320.6pt 366.4pt 412.2pt 458.0pt 503.8pt 549.6pt 595.4pt 641.2pt 687.0pt 732.8pt;&quot;&gt;
&lt;br /&gt;&lt;/div&gt;
&lt;div class=&quot;MsoNormal&quot; style=&quot;line-height: normal; margin-bottom: .0001pt; margin-bottom: 0in; tab-stops: 45.8pt 91.6pt 137.4pt 183.2pt 229.0pt 274.8pt 320.6pt 366.4pt 412.2pt 458.0pt 503.8pt 549.6pt 595.4pt 641.2pt 687.0pt 732.8pt;&quot;&gt;
&lt;span style=&quot;font-size: 10pt;&quot;&gt;config.action_mailer.smtp_settings
= {&lt;/span&gt;&lt;/div&gt;
&lt;div class=&quot;MsoNormal&quot; style=&quot;line-height: normal; margin-bottom: .0001pt; margin-bottom: 0in; tab-stops: 45.8pt 91.6pt 137.4pt 183.2pt 229.0pt 274.8pt 320.6pt 366.4pt 412.2pt 458.0pt 503.8pt 549.6pt 595.4pt 641.2pt 687.0pt 732.8pt;&quot;&gt;
&lt;span style=&quot;font-size: 10pt;&quot;&gt;&amp;nbsp; :enable_starttls_auto =&amp;gt; true,&lt;/span&gt;&lt;/div&gt;
&lt;div class=&quot;MsoNormal&quot; style=&quot;line-height: normal; margin-bottom: .0001pt; margin-bottom: 0in; tab-stops: 45.8pt 91.6pt 137.4pt 183.2pt 229.0pt 274.8pt 320.6pt 366.4pt 412.2pt 458.0pt 503.8pt 549.6pt 595.4pt 641.2pt 687.0pt 732.8pt;&quot;&gt;
&lt;span style=&quot;font-size: 10pt;&quot;&gt;&amp;nbsp; :address&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; =&amp;gt; &#39;smtp.gmail.com&#39;,&lt;/span&gt;&lt;/div&gt;
&lt;div class=&quot;MsoNormal&quot; style=&quot;line-height: normal; margin-bottom: .0001pt; margin-bottom: 0in; tab-stops: 45.8pt 91.6pt 137.4pt 183.2pt 229.0pt 274.8pt 320.6pt 366.4pt 412.2pt 458.0pt 503.8pt 549.6pt 595.4pt 641.2pt 687.0pt 732.8pt;&quot;&gt;
&lt;span style=&quot;font-size: 10pt;&quot;&gt;&amp;nbsp; :port&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; =&amp;gt; 587,&lt;/span&gt;&lt;/div&gt;
&lt;div class=&quot;MsoNormal&quot; style=&quot;line-height: normal; margin-bottom: .0001pt; margin-bottom: 0in; tab-stops: 45.8pt 91.6pt 137.4pt 183.2pt 229.0pt 274.8pt 320.6pt 366.4pt 412.2pt 458.0pt 503.8pt 549.6pt 595.4pt 641.2pt 687.0pt 732.8pt;&quot;&gt;
&lt;span style=&quot;font-size: 10pt;&quot;&gt;&amp;nbsp; :domain&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; =&amp;gt; &#39;your.domain.com&#39;,&lt;/span&gt;&lt;/div&gt;
&lt;div class=&quot;MsoNormal&quot; style=&quot;line-height: normal; margin-bottom: .0001pt; margin-bottom: 0in; tab-stops: 45.8pt 91.6pt 137.4pt 183.2pt 229.0pt 274.8pt 320.6pt 366.4pt 412.2pt 458.0pt 503.8pt 549.6pt 595.4pt 641.2pt 687.0pt 732.8pt;&quot;&gt;
&lt;span style=&quot;font-size: 10pt;&quot;&gt;&amp;nbsp; :authentication =&amp;gt; :login,&lt;/span&gt;&lt;/div&gt;
&lt;div class=&quot;MsoNormal&quot; style=&quot;line-height: normal; margin-bottom: .0001pt; margin-bottom: 0in; tab-stops: 45.8pt 91.6pt 137.4pt 183.2pt 229.0pt 274.8pt 320.6pt 366.4pt 412.2pt 458.0pt 503.8pt 549.6pt 595.4pt 641.2pt 687.0pt 732.8pt;&quot;&gt;
&lt;span style=&quot;font-size: 10pt;&quot;&gt;&amp;nbsp; :content_type&amp;nbsp;&amp;nbsp; =&amp;gt; &quot;text/html&quot;,&lt;/span&gt;&lt;/div&gt;
&lt;div class=&quot;MsoNormal&quot; style=&quot;line-height: normal; margin-bottom: .0001pt; margin-bottom: 0in; tab-stops: 45.8pt 91.6pt 137.4pt 183.2pt 229.0pt 274.8pt 320.6pt 366.4pt 412.2pt 458.0pt 503.8pt 549.6pt 595.4pt 641.2pt 687.0pt 732.8pt;&quot;&gt;
&lt;span style=&quot;font-size: 10pt;&quot;&gt;&amp;nbsp; :user_name&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; =&amp;gt; your full username example
xyz@gmail.com&#39;,&lt;/span&gt;&lt;/div&gt;
&lt;div class=&quot;MsoNormal&quot; style=&quot;line-height: normal; margin-bottom: .0001pt; margin-bottom: 0in; tab-stops: 45.8pt 91.6pt 137.4pt 183.2pt 229.0pt 274.8pt 320.6pt 366.4pt 412.2pt 458.0pt 503.8pt 549.6pt 595.4pt 641.2pt 687.0pt 732.8pt;&quot;&gt;
&lt;span style=&quot;font-size: 10pt;&quot;&gt;&amp;nbsp; :password&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; =&amp;gt; &#39;password&#39;&lt;/span&gt;&lt;/div&gt;
&lt;div class=&quot;MsoNormal&quot; style=&quot;line-height: normal; margin-bottom: .0001pt; margin-bottom: 0in; tab-stops: 45.8pt 91.6pt 137.4pt 183.2pt 229.0pt 274.8pt 320.6pt 366.4pt 412.2pt 458.0pt 503.8pt 549.6pt 595.4pt 641.2pt 687.0pt 732.8pt;&quot;&gt;
&lt;span style=&quot;font-size: 10pt;&quot;&gt;}&lt;/span&gt;&lt;/div&gt;
&lt;/blockquote&gt;
&lt;span style=&quot;background-color: #cccccc;&quot;&gt;

&lt;/span&gt;&lt;br /&gt;
&lt;div class=&quot;MsoNormal&quot; style=&quot;line-height: normal; margin-bottom: .0001pt; margin-bottom: 0in; tab-stops: 45.8pt 91.6pt 137.4pt 183.2pt 229.0pt 274.8pt 320.6pt 366.4pt 412.2pt 458.0pt 503.8pt 549.6pt 595.4pt 641.2pt 687.0pt 732.8pt;&quot;&gt;
&lt;br /&gt;&lt;/div&gt;
&lt;div class=&quot;MsoNormal&quot; style=&quot;line-height: normal; margin-bottom: .0001pt; margin-bottom: 0in; tab-stops: 45.8pt 91.6pt 137.4pt 183.2pt 229.0pt 274.8pt 320.6pt 366.4pt 412.2pt 458.0pt 503.8pt 549.6pt 595.4pt 641.2pt 687.0pt 732.8pt;&quot;&gt;
&lt;br /&gt;&lt;/div&gt;
&lt;div class=&quot;MsoNormal&quot; style=&quot;line-height: normal; margin-bottom: .0001pt; margin-bottom: 0in; tab-stops: 45.8pt 91.6pt 137.4pt 183.2pt 229.0pt 274.8pt 320.6pt 366.4pt 412.2pt 458.0pt 503.8pt 549.6pt 595.4pt 641.2pt 687.0pt 732.8pt;&quot;&gt;
&lt;span style=&quot;font-family: &amp;quot;Courier New&amp;quot;; font-size: 10pt;&quot;&gt;Remember
these are the basic settings needed to send mails from gmail ,other server may
have different settings .&lt;/span&gt;&lt;/div&gt;
&lt;div class=&quot;MsoNormal&quot; style=&quot;line-height: normal; margin-bottom: 0.0001pt;&quot;&gt;
&lt;span style=&quot;font-family: &amp;quot;Courier New&amp;quot;; font-size: 10pt;&quot;&gt;&lt;/span&gt;&lt;/div&gt;
&lt;div class=&quot;MsoNormal&quot; style=&quot;line-height: normal; margin-bottom: 0.0001pt;&quot;&gt;
&lt;/div&gt;
&lt;h2&gt;




&amp;nbsp;&lt;/h2&gt;
&lt;h2&gt;




Creating the mailer&lt;/h2&gt;
&lt;span style=&quot;font-family: &amp;quot;Courier New&amp;quot;; font-size: 10pt;&quot;&gt;&lt;/span&gt;&lt;span style=&quot;font-family: &amp;quot;Courier New&amp;quot;; font-size: 10pt;&quot;&gt;&lt;/span&gt;

&lt;br /&gt;
&lt;div class=&quot;MsoNormal&quot; style=&quot;line-height: normal; margin-bottom: .0001pt; margin-bottom: 0in; tab-stops: 45.8pt 91.6pt 137.4pt 183.2pt 229.0pt 274.8pt 320.6pt 366.4pt 412.2pt 458.0pt 503.8pt 549.6pt 595.4pt 641.2pt 687.0pt 732.8pt;&quot;&gt;
&lt;span style=&quot;font-family: &amp;quot;Courier New&amp;quot;; font-size: 10pt;&quot;&gt;Now
we will write the method in user_mailer model to send the mail .Remember in the
mailer model&lt;/span&gt;&lt;/div&gt;
&lt;div class=&quot;MsoNormal&quot; style=&quot;line-height: normal; margin-bottom: .0001pt; margin-bottom: 0in; tab-stops: 45.8pt 91.6pt 137.4pt 183.2pt 229.0pt 274.8pt 320.6pt 366.4pt 412.2pt 458.0pt 503.8pt 549.6pt 595.4pt 641.2pt 687.0pt 732.8pt;&quot;&gt;
&lt;br /&gt;&lt;/div&gt;
&lt;blockquote class=&quot;tr_bq&quot; style=&quot;background-color: #cccccc; font-family: &amp;quot;Trebuchet MS&amp;quot;,sans-serif;&quot;&gt;
&lt;div class=&quot;MsoNormal&quot; style=&quot;line-height: normal; margin-bottom: .0001pt; margin-bottom: 0in; tab-stops: 45.8pt 91.6pt 137.4pt 183.2pt 229.0pt 274.8pt 320.6pt 366.4pt 412.2pt 458.0pt 503.8pt 549.6pt 595.4pt 641.2pt 687.0pt 732.8pt;&quot;&gt;
&lt;span style=&quot;font-size: 10pt;&quot;&gt;def send_email(user)&lt;/span&gt;&lt;/div&gt;
&lt;div class=&quot;MsoNormal&quot; style=&quot;line-height: normal; margin-bottom: .0001pt; margin-bottom: 0in; tab-stops: 45.8pt 91.6pt 137.4pt 183.2pt 229.0pt 274.8pt 320.6pt 366.4pt 412.2pt 458.0pt 503.8pt 549.6pt 595.4pt 641.2pt 687.0pt 732.8pt;&quot;&gt;
&lt;span style=&quot;font-size: 10pt;&quot;&gt;&amp;nbsp;&amp;nbsp; recipients&amp;nbsp;
user.email&lt;/span&gt;&lt;/div&gt;
&lt;div class=&quot;MsoNormal&quot; style=&quot;line-height: normal; margin-bottom: .0001pt; margin-bottom: 0in; tab-stops: 45.8pt 91.6pt 137.4pt 183.2pt 229.0pt 274.8pt 320.6pt 366.4pt 412.2pt 458.0pt 503.8pt 549.6pt 595.4pt 641.2pt 687.0pt 732.8pt;&quot;&gt;
&lt;span style=&quot;font-size: 10pt;&quot;&gt;&amp;nbsp;&amp;nbsp; from&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;
&quot;webmaster@example.com&quot;&lt;/span&gt;&lt;/div&gt;
&lt;div class=&quot;MsoNormal&quot; style=&quot;line-height: normal; margin-bottom: .0001pt; margin-bottom: 0in; tab-stops: 45.8pt 91.6pt 137.4pt 183.2pt 229.0pt 274.8pt 320.6pt 366.4pt 412.2pt 458.0pt 503.8pt 549.6pt 595.4pt 641.2pt 687.0pt 732.8pt;&quot;&gt;
&lt;span style=&quot;font-size: 10pt;&quot;&gt;&amp;nbsp;&amp;nbsp; subject&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;
&quot;Thank you for Registering&quot;&lt;/span&gt;&lt;/div&gt;
&lt;div class=&quot;MsoNormal&quot; style=&quot;line-height: normal; margin-bottom: .0001pt; margin-bottom: 0in; tab-stops: 45.8pt 91.6pt 137.4pt 183.2pt 229.0pt 274.8pt 320.6pt 366.4pt 412.2pt 458.0pt 503.8pt 549.6pt 595.4pt 641.2pt 687.0pt 732.8pt;&quot;&gt;
&lt;span style=&quot;font-size: 10pt;&quot;&gt;&amp;nbsp;&amp;nbsp; part :content_type =&amp;gt;
&quot;text/html&quot;,&lt;/span&gt;&lt;/div&gt;
&lt;div class=&quot;MsoNormal&quot; style=&quot;line-height: normal; margin-bottom: .0001pt; margin-bottom: 0in; tab-stops: 45.8pt 91.6pt 137.4pt 183.2pt 229.0pt 274.8pt 320.6pt 366.4pt 412.2pt 458.0pt 503.8pt 549.6pt 595.4pt 641.2pt 687.0pt 732.8pt;&quot;&gt;
&lt;span style=&quot;font-size: 10pt;&quot;&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; :body =&amp;gt;
render_message(&quot;registration_confirmation&quot;, :user =&amp;gt; user)&lt;/span&gt;&lt;/div&gt;
&lt;div class=&quot;MsoNormal&quot; style=&quot;line-height: normal; margin-bottom: .0001pt; margin-bottom: 0in; tab-stops: 45.8pt 91.6pt 137.4pt 183.2pt 229.0pt 274.8pt 320.6pt 366.4pt 412.2pt 458.0pt 503.8pt 549.6pt 595.4pt 641.2pt 687.0pt 732.8pt;&quot;&gt;
&lt;span style=&quot;font-size: 10pt;&quot;&gt;end&lt;/span&gt;&lt;/div&gt;
&lt;/blockquote&gt;
&lt;div class=&quot;MsoNormal&quot; style=&quot;line-height: normal; margin-bottom: .0001pt; margin-bottom: 0in; tab-stops: 45.8pt 91.6pt 137.4pt 183.2pt 229.0pt 274.8pt 320.6pt 366.4pt 412.2pt 458.0pt 503.8pt 549.6pt 595.4pt 641.2pt 687.0pt 732.8pt;&quot;&gt;
&lt;br /&gt;&lt;/div&gt;
&lt;div class=&quot;MsoNormal&quot; style=&quot;line-height: normal; margin-bottom: .0001pt; margin-bottom: 0in; tab-stops: 45.8pt 91.6pt 137.4pt 183.2pt 229.0pt 274.8pt 320.6pt 366.4pt 412.2pt 458.0pt 503.8pt 549.6pt 595.4pt 641.2pt 687.0pt 732.8pt;&quot;&gt;
&lt;span style=&quot;font-family: &amp;quot;Courier New&amp;quot;; font-size: 10pt;&quot;&gt;The
from field can be your own or your domains email address. Please check if the
from for field has invalid email the user will not be able to reply .&lt;/span&gt;&lt;/div&gt;
&lt;div class=&quot;MsoNormal&quot; style=&quot;line-height: normal; margin-bottom: .0001pt; margin-bottom: 0in; tab-stops: 45.8pt 91.6pt 137.4pt 183.2pt 229.0pt 274.8pt 320.6pt 366.4pt 412.2pt 458.0pt 503.8pt 549.6pt 595.4pt 641.2pt 687.0pt 732.8pt;&quot;&gt;
&lt;br /&gt;&lt;/div&gt;
&lt;h2&gt;




Creating Email Template&lt;/h2&gt;
&lt;div class=&quot;MsoNormal&quot; style=&quot;line-height: normal; margin-bottom: .0001pt; margin-bottom: 0in; tab-stops: 45.8pt 91.6pt 137.4pt 183.2pt 229.0pt 274.8pt 320.6pt 366.4pt 412.2pt 458.0pt 503.8pt 549.6pt 595.4pt 641.2pt 687.0pt 732.8pt;&quot;&gt;
&lt;span style=&quot;font-family: &amp;quot;Courier New&amp;quot;; font-size: 10pt;&quot;&gt;Now
we will create a view which would form a the email template .It is named as
same as the method in the model user_mailer ie. Send_email.html.erb&lt;/span&gt;&lt;/div&gt;
&lt;div class=&quot;MsoNormal&quot; style=&quot;line-height: normal; margin-bottom: .0001pt; margin-bottom: 0in; tab-stops: 45.8pt 91.6pt 137.4pt 183.2pt 229.0pt 274.8pt 320.6pt 366.4pt 412.2pt 458.0pt 503.8pt 549.6pt 595.4pt 641.2pt 687.0pt 732.8pt;&quot;&gt;
&lt;br /&gt;&lt;/div&gt;
&lt;div class=&quot;MsoNormal&quot; style=&quot;line-height: normal; margin-bottom: .0001pt; margin-bottom: 0in; tab-stops: 45.8pt 91.6pt 137.4pt 183.2pt 229.0pt 274.8pt 320.6pt 366.4pt 412.2pt 458.0pt 503.8pt 549.6pt 595.4pt 641.2pt 687.0pt 732.8pt;&quot;&gt;
&lt;br /&gt;&lt;/div&gt;
&lt;blockquote class=&quot;tr_bq&quot; style=&quot;background-color: #cccccc; font-family: &amp;quot;Trebuchet MS&amp;quot;,sans-serif;&quot;&gt;
&lt;div class=&quot;MsoNormal&quot; style=&quot;line-height: normal; margin-bottom: .0001pt; margin-bottom: 0in; tab-stops: 45.8pt 91.6pt 137.4pt 183.2pt 229.0pt 274.8pt 320.6pt 366.4pt 412.2pt 458.0pt 503.8pt 549.6pt 595.4pt 641.2pt 687.0pt 732.8pt;&quot;&gt;
&lt;span style=&quot;font-size: 10pt;&quot;&gt;&amp;lt;!DOCTYPE
html PUBLIC &quot;-//W3C//DTD HTML 4.01 Transitional//EN&quot;&lt;/span&gt;&lt;/div&gt;
&lt;div class=&quot;MsoNormal&quot; style=&quot;line-height: normal; margin-bottom: .0001pt; margin-bottom: 0in; tab-stops: 45.8pt 91.6pt 137.4pt 183.2pt 229.0pt 274.8pt 320.6pt 366.4pt 412.2pt 458.0pt 503.8pt 549.6pt 595.4pt 641.2pt 687.0pt 732.8pt;&quot;&gt;
&lt;span style=&quot;font-size: 10pt;&quot;&gt;&amp;nbsp;
&quot;http://www.w3.org/TR/html4/loose.dtd&quot;&amp;gt;&lt;/span&gt;&lt;/div&gt;
&lt;div class=&quot;MsoNormal&quot; style=&quot;line-height: normal; margin-bottom: .0001pt; margin-bottom: 0in; tab-stops: 45.8pt 91.6pt 137.4pt 183.2pt 229.0pt 274.8pt 320.6pt 366.4pt 412.2pt 458.0pt 503.8pt 549.6pt 595.4pt 641.2pt 687.0pt 732.8pt;&quot;&gt;
&lt;br /&gt;&lt;/div&gt;
&lt;div class=&quot;MsoNormal&quot; style=&quot;line-height: normal; margin-bottom: .0001pt; margin-bottom: 0in; tab-stops: 45.8pt 91.6pt 137.4pt 183.2pt 229.0pt 274.8pt 320.6pt 366.4pt 412.2pt 458.0pt 503.8pt 549.6pt 595.4pt 641.2pt 687.0pt 732.8pt;&quot;&gt;
&lt;span style=&quot;font-size: 10pt;&quot;&gt;&amp;lt;html
lang=&quot;en&quot;&amp;gt;&lt;/span&gt;&lt;/div&gt;
&lt;div class=&quot;MsoNormal&quot; style=&quot;line-height: normal; margin-bottom: .0001pt; margin-bottom: 0in; tab-stops: 45.8pt 91.6pt 137.4pt 183.2pt 229.0pt 274.8pt 320.6pt 366.4pt 412.2pt 458.0pt 503.8pt 549.6pt 595.4pt 641.2pt 687.0pt 732.8pt;&quot;&gt;
&lt;span style=&quot;font-size: 10pt;&quot;&gt;&amp;nbsp; &amp;lt;head&amp;gt;&lt;/span&gt;&lt;/div&gt;
&lt;div class=&quot;MsoNormal&quot; style=&quot;line-height: normal; margin-bottom: .0001pt; margin-bottom: 0in; tab-stops: 45.8pt 91.6pt 137.4pt 183.2pt 229.0pt 274.8pt 320.6pt 366.4pt 412.2pt 458.0pt 503.8pt 549.6pt 595.4pt 641.2pt 687.0pt 732.8pt;&quot;&gt;
&lt;span style=&quot;font-size: 10pt;&quot;&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; &amp;lt;meta
http-equiv=&quot;Content-Type&quot; content=&quot;text/html;
charset=utf-8&quot;&amp;gt;&lt;/span&gt;&lt;/div&gt;
&lt;div class=&quot;MsoNormal&quot; style=&quot;line-height: normal; margin-bottom: .0001pt; margin-bottom: 0in; tab-stops: 45.8pt 91.6pt 137.4pt 183.2pt 229.0pt 274.8pt 320.6pt 366.4pt 412.2pt 458.0pt 503.8pt 549.6pt 595.4pt 641.2pt 687.0pt 732.8pt;&quot;&gt;
&lt;span style=&quot;font-size: 10pt;&quot;&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; &amp;lt;style type=&quot;text/css&quot;
media=&quot;screen&quot;&amp;gt;&lt;/span&gt;&lt;/div&gt;
&lt;div class=&quot;MsoNormal&quot; style=&quot;line-height: normal; margin-bottom: .0001pt; margin-bottom: 0in; tab-stops: 45.8pt 91.6pt 137.4pt 183.2pt 229.0pt 274.8pt 320.6pt 366.4pt 412.2pt 458.0pt 503.8pt 549.6pt 595.4pt 641.2pt 687.0pt 732.8pt;&quot;&gt;
&lt;span style=&quot;font-size: 10pt;&quot;&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; h3 { color: #f00; }&lt;/span&gt;&lt;/div&gt;
&lt;div class=&quot;MsoNormal&quot; style=&quot;line-height: normal; margin-bottom: .0001pt; margin-bottom: 0in; tab-stops: 45.8pt 91.6pt 137.4pt 183.2pt 229.0pt 274.8pt 320.6pt 366.4pt 412.2pt 458.0pt 503.8pt 549.6pt 595.4pt 641.2pt 687.0pt 732.8pt;&quot;&gt;
&lt;span style=&quot;font-size: 10pt;&quot;&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; ul { list-style: none; }&lt;/span&gt;&lt;/div&gt;
&lt;div class=&quot;MsoNormal&quot; style=&quot;line-height: normal; margin-bottom: .0001pt; margin-bottom: 0in; tab-stops: 45.8pt 91.6pt 137.4pt 183.2pt 229.0pt 274.8pt 320.6pt 366.4pt 412.2pt 458.0pt 503.8pt 549.6pt 595.4pt 641.2pt 687.0pt 732.8pt;&quot;&gt;
&lt;span style=&quot;font-size: 10pt;&quot;&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; &amp;lt;/style&amp;gt;&lt;/span&gt;&lt;/div&gt;
&lt;div class=&quot;MsoNormal&quot; style=&quot;line-height: normal; margin-bottom: .0001pt; margin-bottom: 0in; tab-stops: 45.8pt 91.6pt 137.4pt 183.2pt 229.0pt 274.8pt 320.6pt 366.4pt 412.2pt 458.0pt 503.8pt 549.6pt 595.4pt 641.2pt 687.0pt 732.8pt;&quot;&gt;
&lt;span style=&quot;font-size: 10pt;&quot;&gt;&amp;nbsp; &amp;lt;/head&amp;gt;&lt;/span&gt;&lt;/div&gt;
&lt;div class=&quot;MsoNormal&quot; style=&quot;line-height: normal; margin-bottom: .0001pt; margin-bottom: 0in; tab-stops: 45.8pt 91.6pt 137.4pt 183.2pt 229.0pt 274.8pt 320.6pt 366.4pt 412.2pt 458.0pt 503.8pt 549.6pt 595.4pt 641.2pt 687.0pt 732.8pt;&quot;&gt;
&lt;span style=&quot;font-size: 10pt;&quot;&gt;&amp;nbsp; &amp;lt;body&amp;gt;&lt;/span&gt;&lt;/div&gt;
&lt;div class=&quot;MsoNormal&quot; style=&quot;line-height: normal; margin-bottom: .0001pt; margin-bottom: 0in; tab-stops: 45.8pt 91.6pt 137.4pt 183.2pt 229.0pt 274.8pt 320.6pt 366.4pt 412.2pt 458.0pt 503.8pt 549.6pt 595.4pt 641.2pt 687.0pt 732.8pt;&quot;&gt;
&lt;span style=&quot;font-size: 10pt;&quot;&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; &amp;lt;div&amp;gt;&lt;/span&gt;&lt;/div&gt;
&lt;div class=&quot;MsoNormal&quot; style=&quot;line-height: normal; margin-bottom: .0001pt; margin-bottom: 0in; tab-stops: 45.8pt 91.6pt 137.4pt 183.2pt 229.0pt 274.8pt 320.6pt 366.4pt 412.2pt 458.0pt 503.8pt 549.6pt 595.4pt 641.2pt 687.0pt 732.8pt;&quot;&gt;
&lt;span style=&quot;font-size: 10pt;&quot;&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; &amp;lt;h2 id = &quot;banner&quot;&amp;gt;Your
account signup details are below&amp;lt;/h2&amp;gt;&lt;/span&gt;&lt;/div&gt;
&lt;div class=&quot;MsoNormal&quot; style=&quot;line-height: normal; margin-bottom: .0001pt; margin-bottom: 0in; tab-stops: 45.8pt 91.6pt 137.4pt 183.2pt 229.0pt 274.8pt 320.6pt 366.4pt 412.2pt 458.0pt 503.8pt 549.6pt 595.4pt 641.2pt 687.0pt 732.8pt;&quot;&gt;
&lt;span style=&quot;font-size: 10pt;&quot;&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; &amp;lt;/div&amp;gt;&lt;/span&gt;&lt;/div&gt;
&lt;div class=&quot;MsoNormal&quot; style=&quot;line-height: normal; margin-bottom: .0001pt; margin-bottom: 0in; tab-stops: 45.8pt 91.6pt 137.4pt 183.2pt 229.0pt 274.8pt 320.6pt 366.4pt 412.2pt 458.0pt 503.8pt 549.6pt 595.4pt 641.2pt 687.0pt 732.8pt;&quot;&gt;
&lt;br /&gt;&lt;/div&gt;
&lt;div class=&quot;MsoNormal&quot; style=&quot;line-height: normal; margin-bottom: .0001pt; margin-bottom: 0in; tab-stops: 45.8pt 91.6pt 137.4pt 183.2pt 229.0pt 274.8pt 320.6pt 366.4pt 412.2pt 458.0pt 503.8pt 549.6pt 595.4pt 641.2pt 687.0pt 732.8pt;&quot;&gt;
&lt;span style=&quot;font-size: 10pt;&quot;&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; &amp;lt;ul&amp;gt;&amp;lt;br /&amp;gt;&amp;lt;br /&amp;gt;&lt;/span&gt;&lt;/div&gt;
&lt;div class=&quot;MsoNormal&quot; style=&quot;line-height: normal; margin-bottom: .0001pt; margin-bottom: 0in; tab-stops: 45.8pt 91.6pt 137.4pt 183.2pt 229.0pt 274.8pt 320.6pt 366.4pt 412.2pt 458.0pt 503.8pt 549.6pt 595.4pt 641.2pt 687.0pt 732.8pt;&quot;&gt;
&lt;span style=&quot;font-size: 10pt;&quot;&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; &amp;lt;li&amp;gt;&amp;lt;h2&amp;gt;Name: &amp;lt;b&amp;gt;&amp;lt;%=
@user.name %&amp;gt;&amp;lt;/b&amp;gt; &amp;lt;/h2&amp;gt;&amp;lt;/li&amp;gt;&lt;/span&gt;&lt;/div&gt;
&lt;div class=&quot;MsoNormal&quot; style=&quot;line-height: normal; margin-bottom: .0001pt; margin-bottom: 0in; tab-stops: 45.8pt 91.6pt 137.4pt 183.2pt 229.0pt 274.8pt 320.6pt 366.4pt 412.2pt 458.0pt 503.8pt 549.6pt 595.4pt 641.2pt 687.0pt 732.8pt;&quot;&gt;
&lt;br /&gt;&lt;/div&gt;
&lt;div class=&quot;MsoNormal&quot; style=&quot;line-height: normal; margin-bottom: .0001pt; margin-bottom: 0in; tab-stops: 45.8pt 91.6pt 137.4pt 183.2pt 229.0pt 274.8pt 320.6pt 366.4pt 412.2pt 458.0pt 503.8pt 549.6pt 595.4pt 641.2pt 687.0pt 732.8pt;&quot;&gt;
&lt;span style=&quot;font-size: 10pt;&quot;&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; &amp;lt;li&amp;gt;Login: &amp;lt;%= @user.email
%&amp;gt;&amp;lt;/li&amp;gt;&amp;lt;br /&amp;gt;&amp;lt;br /&amp;gt;&lt;/span&gt;&lt;/div&gt;
&lt;div class=&quot;MsoNormal&quot; style=&quot;line-height: normal; margin-bottom: .0001pt; margin-bottom: 0in; tab-stops: 45.8pt 91.6pt 137.4pt 183.2pt 229.0pt 274.8pt 320.6pt 366.4pt 412.2pt 458.0pt 503.8pt 549.6pt 595.4pt 641.2pt 687.0pt 732.8pt;&quot;&gt;
&lt;br /&gt;&lt;/div&gt;
&lt;div class=&quot;MsoNormal&quot; style=&quot;line-height: normal; margin-bottom: .0001pt; margin-bottom: 0in; tab-stops: 45.8pt 91.6pt 137.4pt 183.2pt 229.0pt 274.8pt 320.6pt 366.4pt 412.2pt 458.0pt 503.8pt 549.6pt 595.4pt 641.2pt 687.0pt 732.8pt;&quot;&gt;
&lt;span style=&quot;font-size: 10pt;&quot;&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; &amp;lt;li&amp;gt;Image: &amp;lt;%= image_tag
&#39;rails.png&#39; %&amp;gt;&amp;lt;/li&amp;gt;&amp;lt;br /&amp;gt;&amp;lt;br /&amp;gt;&lt;/span&gt;&lt;/div&gt;
&lt;div class=&quot;MsoNormal&quot; style=&quot;line-height: normal; margin-bottom: .0001pt; margin-bottom: 0in; tab-stops: 45.8pt 91.6pt 137.4pt 183.2pt 229.0pt 274.8pt 320.6pt 366.4pt 412.2pt 458.0pt 503.8pt 549.6pt 595.4pt 641.2pt 687.0pt 732.8pt;&quot;&gt;
&lt;br /&gt;&lt;/div&gt;
&lt;div class=&quot;MsoNormal&quot; style=&quot;line-height: normal; margin-bottom: .0001pt; margin-bottom: 0in; tab-stops: 45.8pt 91.6pt 137.4pt 183.2pt 229.0pt 274.8pt 320.6pt 366.4pt 412.2pt 458.0pt 503.8pt 549.6pt 595.4pt 641.2pt 687.0pt 732.8pt;&quot;&gt;
&lt;span style=&quot;font-size: 10pt;&quot;&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; &amp;lt;li&amp;gt;Content: &amp;lt;%= @user.content
%&amp;gt;&amp;lt;/li&amp;gt;&lt;/span&gt;&lt;/div&gt;
&lt;div class=&quot;MsoNormal&quot; style=&quot;line-height: normal; margin-bottom: .0001pt; margin-bottom: 0in; tab-stops: 45.8pt 91.6pt 137.4pt 183.2pt 229.0pt 274.8pt 320.6pt 366.4pt 412.2pt 458.0pt 503.8pt 549.6pt 595.4pt 641.2pt 687.0pt 732.8pt;&quot;&gt;
&lt;span style=&quot;font-size: 10pt;&quot;&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; &amp;lt;/ul&amp;gt;&lt;/span&gt;&lt;/div&gt;
&lt;div class=&quot;MsoNormal&quot; style=&quot;line-height: normal; margin-bottom: .0001pt; margin-bottom: 0in; tab-stops: 45.8pt 91.6pt 137.4pt 183.2pt 229.0pt 274.8pt 320.6pt 366.4pt 412.2pt 458.0pt 503.8pt 549.6pt 595.4pt 641.2pt 687.0pt 732.8pt;&quot;&gt;
&lt;span style=&quot;font-size: 10pt;&quot;&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; &lt;/span&gt;&lt;/div&gt;
&lt;div class=&quot;MsoNormal&quot; style=&quot;line-height: normal; margin-bottom: .0001pt; margin-bottom: 0in; tab-stops: 45.8pt 91.6pt 137.4pt 183.2pt 229.0pt 274.8pt 320.6pt 366.4pt 412.2pt 458.0pt 503.8pt 549.6pt 595.4pt 641.2pt 687.0pt 732.8pt;&quot;&gt;
&lt;span style=&quot;font-size: 10pt;&quot;&gt;&amp;nbsp; &amp;lt;/body&amp;gt;&lt;/span&gt;&lt;/div&gt;
&lt;div class=&quot;MsoNormal&quot; style=&quot;line-height: normal; margin-bottom: .0001pt; margin-bottom: 0in; tab-stops: 45.8pt 91.6pt 137.4pt 183.2pt 229.0pt 274.8pt 320.6pt 366.4pt 412.2pt 458.0pt 503.8pt 549.6pt 595.4pt 641.2pt 687.0pt 732.8pt;&quot;&gt;
&lt;span style=&quot;font-size: 10pt;&quot;&gt;&amp;lt;/html&amp;gt;&lt;/span&gt;&lt;/div&gt;
&lt;/blockquote&gt;
&lt;div class=&quot;MsoNormal&quot; style=&quot;line-height: normal; margin-bottom: .0001pt; margin-bottom: 0in; tab-stops: 45.8pt 91.6pt 137.4pt 183.2pt 229.0pt 274.8pt 320.6pt 366.4pt 412.2pt 458.0pt 503.8pt 549.6pt 595.4pt 641.2pt 687.0pt 732.8pt;&quot;&gt;
&lt;br /&gt;&lt;/div&gt;
&lt;div class=&quot;MsoNormal&quot; style=&quot;line-height: normal; margin-bottom: .0001pt; margin-bottom: 0in; tab-stops: 45.8pt 91.6pt 137.4pt 183.2pt 229.0pt 274.8pt 320.6pt 366.4pt 412.2pt 458.0pt 503.8pt 549.6pt 595.4pt 641.2pt 687.0pt 732.8pt;&quot;&gt;
&lt;span style=&quot;font-family: &amp;quot;Courier New&amp;quot;; font-size: 10pt;&quot;&gt;In
the end add a line to the create method of the Users_controller&lt;/span&gt;&lt;/div&gt;
&lt;div class=&quot;MsoNormal&quot; style=&quot;line-height: normal; margin-bottom: .0001pt; margin-bottom: 0in; tab-stops: 45.8pt 91.6pt 137.4pt 183.2pt 229.0pt 274.8pt 320.6pt 366.4pt 412.2pt 458.0pt 503.8pt 549.6pt 595.4pt 641.2pt 687.0pt 732.8pt;&quot;&gt;
&lt;br /&gt;&lt;/div&gt;
&lt;blockquote class=&quot;tr_bq&quot; style=&quot;background-color: #cccccc; font-family: &amp;quot;Trebuchet MS&amp;quot;,sans-serif;&quot;&gt;
&lt;div class=&quot;MsoNormal&quot; style=&quot;line-height: normal; margin-bottom: .0001pt; margin-bottom: 0in; tab-stops: 45.8pt 91.6pt 137.4pt 183.2pt 229.0pt 274.8pt 320.6pt 366.4pt 412.2pt 458.0pt 503.8pt 549.6pt 595.4pt 641.2pt 687.0pt 732.8pt;&quot;&gt;
&lt;span style=&quot;font-size: 10pt;&quot;&gt;&amp;nbsp;UserMailer.deliver_send_email(@user)&lt;/span&gt;&lt;/div&gt;
&lt;/blockquote&gt;
&lt;div class=&quot;MsoNormal&quot; style=&quot;line-height: normal; margin-bottom: .0001pt; margin-bottom: 0in; tab-stops: 45.8pt 91.6pt 137.4pt 183.2pt 229.0pt 274.8pt 320.6pt 366.4pt 412.2pt 458.0pt 503.8pt 549.6pt 595.4pt 641.2pt 687.0pt 732.8pt;&quot;&gt;
&lt;br /&gt;&lt;/div&gt;
&lt;div class=&quot;MsoNormal&quot; style=&quot;line-height: normal; margin-bottom: .0001pt; margin-bottom: 0in; tab-stops: 45.8pt 91.6pt 137.4pt 183.2pt 229.0pt 274.8pt 320.6pt 366.4pt 412.2pt 458.0pt 503.8pt 549.6pt 595.4pt 641.2pt 687.0pt 732.8pt;&quot;&gt;
&lt;span style=&quot;font-family: &amp;quot;Courier New&amp;quot;; font-size: 10pt;&quot;&gt;The
method is referred to as deliver_send_email because rails appends it to a
mailer method.&lt;/span&gt;&lt;/div&gt;
&lt;div class=&quot;MsoNormal&quot; style=&quot;line-height: normal; margin-bottom: .0001pt; margin-bottom: 0in; tab-stops: 45.8pt 91.6pt 137.4pt 183.2pt 229.0pt 274.8pt 320.6pt 366.4pt 412.2pt 458.0pt 503.8pt 549.6pt 595.4pt 641.2pt 687.0pt 732.8pt;&quot;&gt;
&lt;br /&gt;&lt;/div&gt;
&lt;div class=&quot;MsoNormal&quot; style=&quot;line-height: normal; margin-bottom: .0001pt; margin-bottom: 0in; tab-stops: 45.8pt 91.6pt 137.4pt 183.2pt 229.0pt 274.8pt 320.6pt 366.4pt 412.2pt 458.0pt 503.8pt 549.6pt 595.4pt 641.2pt 687.0pt 732.8pt;&quot;&gt;
&lt;span style=&quot;font-family: &amp;quot;Courier New&amp;quot;; font-size: 10pt;&quot;&gt;Now
run the server and try creating a new user . The email is sent to the address
the user enters for the new record.&lt;/span&gt;&lt;/div&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://rorashish.blogspot.com/feeds/2024220746965492417/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://rorashish.blogspot.com/2011/11/action-mailer-239-easy-email-delivery.html#comment-form' title='3 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/2936127337406425108/posts/default/2024220746965492417'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/2936127337406425108/posts/default/2024220746965492417'/><link rel='alternate' type='text/html' href='http://rorashish.blogspot.com/2011/11/action-mailer-239-easy-email-delivery.html' title='Action Mailer 2.3.9 — Easy email delivery and testing'/><author><name>Anonymous</name><uri>http://www.blogger.com/profile/14643110071701140642</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='16' height='16' src='https://img1.blogblog.com/img/b16-rounded.gif'/></author><thr:total>3</thr:total><georss:featurename>Chandivali Farm Rd, Chandivali, Mumbai, Maharashtra, India</georss:featurename><georss:point>19.114029215761995 72.894287109375</georss:point><georss:box>18.873844215761995 72.578430109375 19.354214215761996 73.210144109375</georss:box></entry><entry><id>tag:blogger.com,1999:blog-2936127337406425108.post-6660224044996331251</id><published>2011-09-29T11:28:00.001+05:30</published><updated>2011-11-06T19:12:59.674+05:30</updated><category scheme="http://www.blogger.com/atom/ns#" term="metasearch rails 3.1"/><category scheme="http://www.blogger.com/atom/ns#" term="ror search"/><category scheme="http://www.blogger.com/atom/ns#" term="ror search squeel"/><category scheme="http://www.blogger.com/atom/ns#" term="search rails 3.1"/><category scheme="http://www.blogger.com/atom/ns#" term="search ruby"/><category scheme="http://www.blogger.com/atom/ns#" term="squeel"/><title type='text'>Squeel: Replacement for metawhere Gem in Rails 3.1</title><content type='html'>&lt;div dir=&quot;ltr&quot; style=&quot;text-align: left;&quot; trbidi=&quot;on&quot;&gt;
&lt;br /&gt;
&lt;h2 style=&quot;border-bottom-width: 0px !important; border-color: initial !important; border-left-width: 0px !important; border-right-width: 0px !important; border-style: initial !important; border-top-color: rgb(224, 224, 224) !important; border-top-style: solid !important; border-top-width: 4px !important; font-size: 20px; margin-bottom: 1em; margin-left: 0px; margin-right: 0px; margin-top: 1.5em !important; padding-bottom: 0px; padding-left: 0px; padding-right: 0px; padding-top: 0.5em !important;&quot;&gt;

Getting started&lt;/h2&gt;
&lt;div style=&quot;line-height: 1.5em !important; margin-bottom: 1em !important; margin-top: 1em !important; padding-bottom: 0px; padding-left: 0px; padding-right: 0px; padding-top: 0px;&quot;&gt;
In your Gemfile:&lt;/div&gt;
&lt;pre style=&quot;-webkit-box-shadow: rgba(0, 0, 0, 0.0664063) 0px 1px 2px inset; background-color: #eeeeee; border-bottom-color: rgb(221, 221, 221); border-bottom-left-radius: 3px 3px; border-bottom-right-radius: 3px 3px; border-bottom-style: solid; border-bottom-width: 1px; border-left-color: rgb(221, 221, 221); border-left-style: solid; border-left-width: 1px; border-right-color: rgb(221, 221, 221); border-right-style: solid; border-right-width: 1px; border-top-color: rgb(221, 221, 221); border-top-left-radius: 3px 3px; border-top-right-radius: 3px 3px; border-top-style: solid; border-top-width: 1px; color: #444444; font-size: 12px; font: normal normal normal 12px/normal &#39;Bitstream Vera Sans Mono&#39;, Courier, monospace; margin-bottom: 1em; margin-top: 1em; overflow-x: auto; overflow-y: auto; padding-bottom: 5px; padding-left: 5px; padding-right: 5px; padding-top: 5px;&quot;&gt;&lt;code style=&quot;background-color: rgb(238, 238, 238) !important; border-bottom-color: rgb(222, 222, 222) !important; border-bottom-style: none !important; border-bottom-width: 1px !important; border-color: initial !important; border-left-color: rgb(222, 222, 222) !important; border-left-style: none !important; border-left-width: 1px !important; border-right-color: rgb(222, 222, 222) !important; border-right-style: none !important; border-right-width: 1px !important; border-top-color: rgb(222, 222, 222) !important; border-top-style: none !important; border-top-width: 1px !important; border-width: initial !important; color: rgb(68, 68, 68) !important; font-size: 12px !important; font: normal normal normal 12px/normal &#39;Bitstream Vera Sans Mono&#39;, Courier, monospace; margin-bottom: 0px; margin-left: 0px; margin-right: 0px; margin-top: 0px; padding-bottom: 0px !important; padding-left: 0px !important; padding-right: 0px !important; padding-top: 0px !important;&quot;&gt;gem &quot;squeel&quot;  # Last officially released gem
# gem &quot;squeel&quot;, :git =&amp;gt; &quot;git://github.com/ernie/squeel.git&quot; # Track git repo
&lt;/code&gt;&lt;/pre&gt;
&lt;div style=&quot;line-height: 1.5em !important; margin-bottom: 1em !important; margin-top: 1em !important; padding-bottom: 0px; padding-left: 0px; padding-right: 0px; padding-top: 0px;&quot;&gt;
In an initializer:&lt;/div&gt;
&lt;pre style=&quot;-webkit-box-shadow: rgba(0, 0, 0, 0.0664063) 0px 1px 2px inset; background-color: #eeeeee; border-bottom-color: rgb(221, 221, 221); border-bottom-left-radius: 3px 3px; border-bottom-right-radius: 3px 3px; border-bottom-style: solid; border-bottom-width: 1px; border-left-color: rgb(221, 221, 221); border-left-style: solid; border-left-width: 1px; border-right-color: rgb(221, 221, 221); border-right-style: solid; border-right-width: 1px; border-top-color: rgb(221, 221, 221); border-top-left-radius: 3px 3px; border-top-right-radius: 3px 3px; border-top-style: solid; border-top-width: 1px; color: #444444; font-size: 12px; font: normal normal normal 12px/normal &#39;Bitstream Vera Sans Mono&#39;, Courier, monospace; margin-bottom: 1em; margin-top: 1em; overflow-x: auto; overflow-y: auto; padding-bottom: 5px; padding-left: 5px; padding-right: 5px; padding-top: 5px;&quot;&gt;&lt;code style=&quot;background-color: rgb(238, 238, 238) !important; border-bottom-color: rgb(222, 222, 222) !important; border-bottom-style: none !important; border-bottom-width: 1px !important; border-color: initial !important; border-left-color: rgb(222, 222, 222) !important; border-left-style: none !important; border-left-width: 1px !important; border-right-color: rgb(222, 222, 222) !important; border-right-style: none !important; border-right-width: 1px !important; border-top-color: rgb(222, 222, 222) !important; border-top-style: none !important; border-top-width: 1px !important; border-width: initial !important; color: rgb(68, 68, 68) !important; font-size: 12px !important; font: normal normal normal 12px/normal &#39;Bitstream Vera Sans Mono&#39;, Courier, monospace; margin-bottom: 0px; margin-left: 0px; margin-right: 0px; margin-top: 0px; padding-bottom: 0px !important; padding-left: 0px !important; padding-right: 0px !important; padding-top: 0px !important;&quot;&gt;Squeel.configure do |config|
  # To load hash extensions (to allow for AND (&amp;amp;), OR (|), and NOT (-) against
  # hashes of conditions)
  config.load_core_extensions :hash

  # To load symbol extensions (for a subset of the old MetaWhere functionality,
  # via ARel predicate methods on Symbols: :name.matches, etc)
  # config.load_core_extensions :symbol

  # To load both hash and symbol extensions
  # config.load_core_extensions :hash, :symbol
end
&lt;/code&gt;&lt;/pre&gt;
&lt;h2 style=&quot;border-bottom-width: 0px !important; border-color: initial !important; border-left-width: 0px !important; border-right-width: 0px !important; border-style: initial !important; border-top-color: rgb(224, 224, 224) !important; border-top-style: solid !important; border-top-width: 4px !important; font-size: 20px; margin-bottom: 1em; margin-left: 0px; margin-right: 0px; margin-top: 1.5em !important; padding-bottom: 0px; padding-left: 0px; padding-right: 0px; padding-top: 0.5em !important;&quot;&gt;

The Squeel Query DSL&lt;/h2&gt;
&lt;div style=&quot;line-height: 1.5em !important; margin-bottom: 1em !important; margin-top: 1em !important; padding-bottom: 0px; padding-left: 0px; padding-right: 0px; padding-top: 0px;&quot;&gt;
Squeel enhances the normal ActiveRecord query methods by enabling them to accept blocks. Inside a block, the Squeel query DSL can be used. Note the use of curly braces in these examples instead of parentheses.&amp;nbsp;&lt;code style=&quot;background-color: rgb(248, 248, 255) !important; border-bottom-color: rgb(222, 222, 222) !important; border-bottom-style: solid !important; border-bottom-width: 1px !important; border-left-color: rgb(222, 222, 222) !important; border-left-style: solid !important; border-left-width: 1px !important; border-right-color: rgb(222, 222, 222) !important; border-right-style: solid !important; border-right-width: 1px !important; border-top-color: rgb(222, 222, 222) !important; border-top-style: solid !important; border-top-width: 1px !important; color: rgb(68, 68, 68) !important; font-size: 12px !important; font: normal normal normal 12px/normal &#39;Bitstream Vera Sans Mono&#39;, Courier, monospace; margin-bottom: 0px; margin-left: 0px; margin-right: 0px; margin-top: 0px; padding-bottom: 0px !important; padding-left: 0.2em !important; padding-right: 0.2em !important; padding-top: 0px !important;&quot;&gt;{}&lt;/code&gt;&amp;nbsp;denotes a Squeel DSL query.&lt;/div&gt;
&lt;div style=&quot;line-height: 1.5em !important; margin-bottom: 1em !important; margin-top: 1em !important; padding-bottom: 0px; padding-left: 0px; padding-right: 0px; padding-top: 0px;&quot;&gt;
Stubs and keypaths are the two primary building blocks used in a Squeel DSL query, so we&#39;ll start by taking a look at them. Most of the other examples that follow will be based on this &quot;symbol-less&quot; block syntax.&lt;/div&gt;
&lt;div style=&quot;line-height: 1.5em !important; margin-bottom: 1em !important; margin-top: 1em !important; padding-bottom: 0px; padding-left: 0px; padding-right: 0px; padding-top: 0px;&quot;&gt;
&lt;b style=&quot;margin-bottom: 0px; margin-left: 0px; margin-right: 0px; margin-top: 0px; padding-bottom: 0px; padding-left: 0px; padding-right: 0px; padding-top: 0px;&quot;&gt;An important gotcha, before we begin:&lt;/b&gt;&amp;nbsp;The Squeel DSL works its magic using&amp;nbsp;&lt;code style=&quot;background-color: rgb(248, 248, 255) !important; border-bottom-color: rgb(222, 222, 222) !important; border-bottom-style: solid !important; border-bottom-width: 1px !important; border-left-color: rgb(222, 222, 222) !important; border-left-style: solid !important; border-left-width: 1px !important; border-right-color: rgb(222, 222, 222) !important; border-right-style: solid !important; border-right-width: 1px !important; border-top-color: rgb(222, 222, 222) !important; border-top-style: solid !important; border-top-width: 1px !important; color: rgb(68, 68, 68) !important; font-size: 12px !important; font: normal normal normal 12px/normal &#39;Bitstream Vera Sans Mono&#39;, Courier, monospace; margin-bottom: 0px; margin-left: 0px; margin-right: 0px; margin-top: 0px; padding-bottom: 0px !important; padding-left: 0.2em !important; padding-right: 0.2em !important; padding-top: 0px !important;&quot;&gt;instance_eval&lt;/code&gt;. If you&#39;ve been working with Ruby for a while, you&#39;ll know immediately that this means that&amp;nbsp;&lt;i style=&quot;margin-bottom: 0px; margin-left: 0px; margin-right: 0px; margin-top: 0px; padding-bottom: 0px; padding-left: 0px; padding-right: 0px; padding-top: 0px;&quot;&gt;inside&lt;/i&gt;&amp;nbsp;a Squeel DSL block,&amp;nbsp;&lt;code style=&quot;background-color: rgb(248, 248, 255) !important; border-bottom-color: rgb(222, 222, 222) !important; border-bottom-style: solid !important; border-bottom-width: 1px !important; border-left-color: rgb(222, 222, 222) !important; border-left-style: solid !important; border-left-width: 1px !important; border-right-color: rgb(222, 222, 222) !important; border-right-style: solid !important; border-right-width: 1px !important; border-top-color: rgb(222, 222, 222) !important; border-top-style: solid !important; border-top-width: 1px !important; color: rgb(68, 68, 68) !important; font-size: 12px !important; font: normal normal normal 12px/normal &#39;Bitstream Vera Sans Mono&#39;, Courier, monospace; margin-bottom: 0px; margin-left: 0px; margin-right: 0px; margin-top: 0px; padding-bottom: 0px !important; padding-left: 0.2em !important; padding-right: 0.2em !important; padding-top: 0px !important;&quot;&gt;self&lt;/code&gt;&amp;nbsp;isn&#39;t the same thing that it is&amp;nbsp;&lt;i style=&quot;margin-bottom: 0px; margin-left: 0px; margin-right: 0px; margin-top: 0px; padding-bottom: 0px; padding-left: 0px; padding-right: 0px; padding-top: 0px;&quot;&gt;outside&lt;/i&gt;&amp;nbsp;the block.&lt;/div&gt;
&lt;div style=&quot;line-height: 1.5em !important; margin-bottom: 1em !important; margin-top: 1em !important; padding-bottom: 0px; padding-left: 0px; padding-right: 0px; padding-top: 0px;&quot;&gt;
This carries with it an important implication:&amp;nbsp;&lt;b style=&quot;margin-bottom: 0px; margin-left: 0px; margin-right: 0px; margin-top: 0px; padding-bottom: 0px; padding-left: 0px; padding-right: 0px; padding-top: 0px;&quot;&gt;Instance variables and instance methods inside the block won&#39;t refer to your object&#39;s variables/methods.&lt;/b&gt;&lt;/div&gt;
&lt;div style=&quot;line-height: 1.5em !important; margin-bottom: 1em !important; margin-top: 1em !important; padding-bottom: 0px; padding-left: 0px; padding-right: 0px; padding-top: 0px;&quot;&gt;
Don&#39;t worry, Squeel&#39;s got you covered. Use one of the following methods to get access to your object&#39;s methods and variables:&lt;/div&gt;
&lt;ol style=&quot;margin-bottom: 1em !important; margin-left: 2em !important; margin-right: 0px !important; margin-top: 1em !important; padding-bottom: 0px; padding-left: 0px; padding-right: 0px; padding-top: 0px;&quot;&gt;
&lt;li style=&quot;margin-bottom: 0.5em; margin-left: 0px; margin-right: 0px; margin-top: 0.5em; padding-bottom: 0px; padding-left: 0px; padding-right: 0px; padding-top: 0px;&quot;&gt;Assign the variable locally before the DSL block, and access it as you would normally.&lt;/li&gt;
&lt;li style=&quot;margin-bottom: 0.5em; margin-left: 0px; margin-right: 0px; margin-top: 0.5em; padding-bottom: 0px; padding-left: 0px; padding-right: 0px; padding-top: 0px;&quot;&gt;Supply an arity to the DSL block, as in&amp;nbsp;&lt;code style=&quot;background-color: rgb(248, 248, 255) !important; border-bottom-color: rgb(222, 222, 222) !important; border-bottom-style: solid !important; border-bottom-width: 1px !important; border-left-color: rgb(222, 222, 222) !important; border-left-style: solid !important; border-left-width: 1px !important; border-right-color: rgb(222, 222, 222) !important; border-right-style: solid !important; border-right-width: 1px !important; border-top-color: rgb(222, 222, 222) !important; border-top-style: solid !important; border-top-width: 1px !important; color: rgb(68, 68, 68) !important; font-size: 12px !important; font: normal normal normal 12px/normal &#39;Bitstream Vera Sans Mono&#39;, Courier, monospace; margin-bottom: 0px; margin-left: 0px; margin-right: 0px; margin-top: 0px; padding-bottom: 0px !important; padding-left: 0.2em !important; padding-right: 0.2em !important; padding-top: 0px !important;&quot;&gt;Person.where{|q| q.name == @my_name}&lt;/code&gt;&amp;nbsp;Downside: You&#39;ll need to prefix stubs, keypaths, and functions (explained below) with the DSL object.&lt;/li&gt;
&lt;li style=&quot;margin-bottom: 0.5em; margin-left: 0px; margin-right: 0px; margin-top: 0.5em; padding-bottom: 0px; padding-left: 0px; padding-right: 0px; padding-top: 0px;&quot;&gt;Wrap the method or instance variable inside the block with&amp;nbsp;&lt;code style=&quot;background-color: rgb(248, 248, 255) !important; border-bottom-color: rgb(222, 222, 222) !important; border-bottom-style: solid !important; border-bottom-width: 1px !important; border-left-color: rgb(222, 222, 222) !important; border-left-style: solid !important; border-left-width: 1px !important; border-right-color: rgb(222, 222, 222) !important; border-right-style: solid !important; border-right-width: 1px !important; border-top-color: rgb(222, 222, 222) !important; border-top-style: solid !important; border-top-width: 1px !important; color: rgb(68, 68, 68) !important; font-size: 12px !important; font: normal normal normal 12px/normal &#39;Bitstream Vera Sans Mono&#39;, Courier, monospace; margin-bottom: 0px; margin-left: 0px; margin-right: 0px; margin-top: 0px; padding-bottom: 0px !important; padding-left: 0.2em !important; padding-right: 0.2em !important; padding-top: 0px !important;&quot;&gt;my{}&lt;/code&gt;.&amp;nbsp;&lt;code style=&quot;background-color: rgb(248, 248, 255) !important; border-bottom-color: rgb(222, 222, 222) !important; border-bottom-style: solid !important; border-bottom-width: 1px !important; border-left-color: rgb(222, 222, 222) !important; border-left-style: solid !important; border-left-width: 1px !important; border-right-color: rgb(222, 222, 222) !important; border-right-style: solid !important; border-right-width: 1px !important; border-top-color: rgb(222, 222, 222) !important; border-top-style: solid !important; border-top-width: 1px !important; color: rgb(68, 68, 68) !important; font-size: 12px !important; font: normal normal normal 12px/normal &#39;Bitstream Vera Sans Mono&#39;, Courier, monospace; margin-bottom: 0px; margin-left: 0px; margin-right: 0px; margin-top: 0px; padding-bottom: 0px !important; padding-left: 0.2em !important; padding-right: 0.2em !important; padding-top: 0px !important;&quot;&gt;Person.where{name == my{some_method_to_return_a_name}}&lt;/code&gt;&lt;/li&gt;
&lt;/ol&gt;
&lt;h3 style=&quot;border-bottom-width: 0px !important; border-color: initial !important; border-left-width: 0px !important; border-right-width: 0px !important; border-style: initial !important; border-top-width: 0px !important; margin-bottom: 1em; margin-left: 0px; margin-right: 0px; margin-top: 1em !important; padding-bottom: 0px; padding-left: 0px; padding-right: 0px; padding-top: 0px;&quot;&gt;

Stubs&lt;/h3&gt;
&lt;div style=&quot;line-height: 1.5em !important; margin-bottom: 1em !important; margin-top: 1em !important; padding-bottom: 0px; padding-left: 0px; padding-right: 0px; padding-top: 0px;&quot;&gt;
Stubs are, for most intents and purposes, just like Symbols in a normal call to&amp;nbsp;&lt;code style=&quot;background-color: rgb(248, 248, 255) !important; border-bottom-color: rgb(222, 222, 222) !important; border-bottom-style: solid !important; border-bottom-width: 1px !important; border-left-color: rgb(222, 222, 222) !important; border-left-style: solid !important; border-left-width: 1px !important; border-right-color: rgb(222, 222, 222) !important; border-right-style: solid !important; border-right-width: 1px !important; border-top-color: rgb(222, 222, 222) !important; border-top-style: solid !important; border-top-width: 1px !important; color: rgb(68, 68, 68) !important; font-size: 12px !important; font: normal normal normal 12px/normal &#39;Bitstream Vera Sans Mono&#39;, Courier, monospace; margin-bottom: 0px; margin-left: 0px; margin-right: 0px; margin-top: 0px; padding-bottom: 0px !important; padding-left: 0.2em !important; padding-right: 0.2em !important; padding-top: 0px !important;&quot;&gt;Relation#where&lt;/code&gt;&amp;nbsp;(note the need for doubling up on the curly braces here, the first ones start the block, the second are the hash braces):&lt;/div&gt;
&lt;pre style=&quot;-webkit-box-shadow: rgba(0, 0, 0, 0.0664063) 0px 1px 2px inset; background-color: #eeeeee; border-bottom-color: rgb(221, 221, 221); border-bottom-left-radius: 3px 3px; border-bottom-right-radius: 3px 3px; border-bottom-style: solid; border-bottom-width: 1px; border-left-color: rgb(221, 221, 221); border-left-style: solid; border-left-width: 1px; border-right-color: rgb(221, 221, 221); border-right-style: solid; border-right-width: 1px; border-top-color: rgb(221, 221, 221); border-top-left-radius: 3px 3px; border-top-right-radius: 3px 3px; border-top-style: solid; border-top-width: 1px; color: #444444; font-size: 12px; font: normal normal normal 12px/normal &#39;Bitstream Vera Sans Mono&#39;, Courier, monospace; margin-bottom: 1em; margin-top: 1em; overflow-x: auto; overflow-y: auto; padding-bottom: 5px; padding-left: 5px; padding-right: 5px; padding-top: 5px;&quot;&gt;&lt;code style=&quot;background-color: rgb(238, 238, 238) !important; border-bottom-color: rgb(222, 222, 222) !important; border-bottom-style: none !important; border-bottom-width: 1px !important; border-color: initial !important; border-left-color: rgb(222, 222, 222) !important; border-left-style: none !important; border-left-width: 1px !important; border-right-color: rgb(222, 222, 222) !important; border-right-style: none !important; border-right-width: 1px !important; border-top-color: rgb(222, 222, 222) !important; border-top-style: none !important; border-top-width: 1px !important; border-width: initial !important; color: rgb(68, 68, 68) !important; font-size: 12px !important; font: normal normal normal 12px/normal &#39;Bitstream Vera Sans Mono&#39;, Courier, monospace; margin-bottom: 0px; margin-left: 0px; margin-right: 0px; margin-top: 0px; padding-bottom: 0px !important; padding-left: 0px !important; padding-right: 0px !important; padding-top: 0px !important;&quot;&gt;Person.where{{name =&amp;gt; &#39;Ernie&#39;}}
=&amp;gt; SELECT &quot;people&quot;.* FROM &quot;people&quot;  WHERE &quot;people&quot;.&quot;name&quot; = &#39;Ernie&#39;
&lt;/code&gt;&lt;/pre&gt;
&lt;div style=&quot;line-height: 1.5em !important; margin-bottom: 1em !important; margin-top: 1em !important; padding-bottom: 0px; padding-left: 0px; padding-right: 0px; padding-top: 0px;&quot;&gt;
You normally wouldn&#39;t bother using the DSL in this case, as a simple hash would suffice. However, stubs serve as a building block for keypaths, and keypaths are very handy.&lt;/div&gt;
&lt;h3 style=&quot;border-bottom-width: 0px !important; border-color: initial !important; border-left-width: 0px !important; border-right-width: 0px !important; border-style: initial !important; border-top-width: 0px !important; margin-bottom: 1em; margin-left: 0px; margin-right: 0px; margin-top: 1em !important; padding-bottom: 0px; padding-left: 0px; padding-right: 0px; padding-top: 0px;&quot;&gt;

KeyPaths&lt;/h3&gt;
&lt;div style=&quot;line-height: 1.5em !important; margin-bottom: 1em !important; margin-top: 1em !important; padding-bottom: 0px; padding-left: 0px; padding-right: 0px; padding-top: 0px;&quot;&gt;
A Squeel keypath is essentially a more concise and readable alternative to a deeply nested hash. For instance, in standard ActiveRecord, you might join several associations like this to perform a query:&lt;/div&gt;
&lt;pre style=&quot;-webkit-box-shadow: rgba(0, 0, 0, 0.0664063) 0px 1px 2px inset; background-color: #eeeeee; border-bottom-color: rgb(221, 221, 221); border-bottom-left-radius: 3px 3px; border-bottom-right-radius: 3px 3px; border-bottom-style: solid; border-bottom-width: 1px; border-left-color: rgb(221, 221, 221); border-left-style: solid; border-left-width: 1px; border-right-color: rgb(221, 221, 221); border-right-style: solid; border-right-width: 1px; border-top-color: rgb(221, 221, 221); border-top-left-radius: 3px 3px; border-top-right-radius: 3px 3px; border-top-style: solid; border-top-width: 1px; color: #444444; font-size: 12px; font: normal normal normal 12px/normal &#39;Bitstream Vera Sans Mono&#39;, Courier, monospace; margin-bottom: 1em; margin-top: 1em; overflow-x: auto; overflow-y: auto; padding-bottom: 5px; padding-left: 5px; padding-right: 5px; padding-top: 5px;&quot;&gt;&lt;code style=&quot;background-color: rgb(238, 238, 238) !important; border-bottom-color: rgb(222, 222, 222) !important; border-bottom-style: none !important; border-bottom-width: 1px !important; border-color: initial !important; border-left-color: rgb(222, 222, 222) !important; border-left-style: none !important; border-left-width: 1px !important; border-right-color: rgb(222, 222, 222) !important; border-right-style: none !important; border-right-width: 1px !important; border-top-color: rgb(222, 222, 222) !important; border-top-style: none !important; border-top-width: 1px !important; border-width: initial !important; color: rgb(68, 68, 68) !important; font-size: 12px !important; font: normal normal normal 12px/normal &#39;Bitstream Vera Sans Mono&#39;, Courier, monospace; margin-bottom: 0px; margin-left: 0px; margin-right: 0px; margin-top: 0px; padding-bottom: 0px !important; padding-left: 0px !important; padding-right: 0px !important; padding-top: 0px !important;&quot;&gt;Person.joins(:articles =&amp;gt; {:comments =&amp;gt; :person})
=&amp;gt; SELECT &quot;people&quot;.* FROM &quot;people&quot;
     INNER JOIN &quot;articles&quot; ON &quot;articles&quot;.&quot;person_id&quot; = &quot;people&quot;.&quot;id&quot;
     INNER JOIN &quot;comments&quot; ON &quot;comments&quot;.&quot;article_id&quot; = &quot;articles&quot;.&quot;id&quot;
     INNER JOIN &quot;people&quot; &quot;people_comments&quot; ON &quot;people_comments&quot;.&quot;id&quot; = &quot;comments&quot;.&quot;person_id&quot;
&lt;/code&gt;&lt;/pre&gt;
&lt;div style=&quot;line-height: 1.5em !important; margin-bottom: 1em !important; margin-top: 1em !important; padding-bottom: 0px; padding-left: 0px; padding-right: 0px; padding-top: 0px;&quot;&gt;
With a keypath, this would look like:&lt;/div&gt;
&lt;pre style=&quot;-webkit-box-shadow: rgba(0, 0, 0, 0.0664063) 0px 1px 2px inset; background-color: #eeeeee; border-bottom-color: rgb(221, 221, 221); border-bottom-left-radius: 3px 3px; border-bottom-right-radius: 3px 3px; border-bottom-style: solid; border-bottom-width: 1px; border-left-color: rgb(221, 221, 221); border-left-style: solid; border-left-width: 1px; border-right-color: rgb(221, 221, 221); border-right-style: solid; border-right-width: 1px; border-top-color: rgb(221, 221, 221); border-top-left-radius: 3px 3px; border-top-right-radius: 3px 3px; border-top-style: solid; border-top-width: 1px; color: #444444; font-size: 12px; font: normal normal normal 12px/normal &#39;Bitstream Vera Sans Mono&#39;, Courier, monospace; margin-bottom: 1em; margin-top: 1em; overflow-x: auto; overflow-y: auto; padding-bottom: 5px; padding-left: 5px; padding-right: 5px; padding-top: 5px;&quot;&gt;&lt;code style=&quot;background-color: rgb(238, 238, 238) !important; border-bottom-color: rgb(222, 222, 222) !important; border-bottom-style: none !important; border-bottom-width: 1px !important; border-color: initial !important; border-left-color: rgb(222, 222, 222) !important; border-left-style: none !important; border-left-width: 1px !important; border-right-color: rgb(222, 222, 222) !important; border-right-style: none !important; border-right-width: 1px !important; border-top-color: rgb(222, 222, 222) !important; border-top-style: none !important; border-top-width: 1px !important; border-width: initial !important; color: rgb(68, 68, 68) !important; font-size: 12px !important; font: normal normal normal 12px/normal &#39;Bitstream Vera Sans Mono&#39;, Courier, monospace; margin-bottom: 0px; margin-left: 0px; margin-right: 0px; margin-top: 0px; padding-bottom: 0px !important; padding-left: 0px !important; padding-right: 0px !important; padding-top: 0px !important;&quot;&gt;Person.joins{articles.comments.person}
&lt;/code&gt;&lt;/pre&gt;
&lt;div style=&quot;line-height: 1.5em !important; margin-bottom: 1em !important; margin-top: 1em !important; padding-bottom: 0px; padding-left: 0px; padding-right: 0px; padding-top: 0px;&quot;&gt;
A keypath can exist in the context of a hash, and is normally interpreted relative to the current level of nesting. It can be forced into an &quot;absolute&quot; path by anchoring it with a ~, like:&lt;/div&gt;
&lt;pre style=&quot;-webkit-box-shadow: rgba(0, 0, 0, 0.0664063) 0px 1px 2px inset; background-color: #eeeeee; border-bottom-color: rgb(221, 221, 221); border-bottom-left-radius: 3px 3px; border-bottom-right-radius: 3px 3px; border-bottom-style: solid; border-bottom-width: 1px; border-left-color: rgb(221, 221, 221); border-left-style: solid; border-left-width: 1px; border-right-color: rgb(221, 221, 221); border-right-style: solid; border-right-width: 1px; border-top-color: rgb(221, 221, 221); border-top-left-radius: 3px 3px; border-top-right-radius: 3px 3px; border-top-style: solid; border-top-width: 1px; color: #444444; font-size: 12px; font: normal normal normal 12px/normal &#39;Bitstream Vera Sans Mono&#39;, Courier, monospace; margin-bottom: 1em; margin-top: 1em; overflow-x: auto; overflow-y: auto; padding-bottom: 5px; padding-left: 5px; padding-right: 5px; padding-top: 5px;&quot;&gt;&lt;code style=&quot;background-color: rgb(238, 238, 238) !important; border-bottom-color: rgb(222, 222, 222) !important; border-bottom-style: none !important; border-bottom-width: 1px !important; border-color: initial !important; border-left-color: rgb(222, 222, 222) !important; border-left-style: none !important; border-left-width: 1px !important; border-right-color: rgb(222, 222, 222) !important; border-right-style: none !important; border-right-width: 1px !important; border-top-color: rgb(222, 222, 222) !important; border-top-style: none !important; border-top-width: 1px !important; border-width: initial !important; color: rgb(68, 68, 68) !important; font-size: 12px !important; font: normal normal normal 12px/normal &#39;Bitstream Vera Sans Mono&#39;, Courier, monospace; margin-bottom: 0px; margin-left: 0px; margin-right: 0px; margin-top: 0px; padding-bottom: 0px !important; padding-left: 0px !important; padding-right: 0px !important; padding-top: 0px !important;&quot;&gt;~articles.comments.person
&lt;/code&gt;&lt;/pre&gt;
&lt;div style=&quot;line-height: 1.5em !important; margin-bottom: 1em !important; margin-top: 1em !important; padding-bottom: 0px; padding-left: 0px; padding-right: 0px; padding-top: 0px;&quot;&gt;
This isn&#39;t quite so useful in the typical hash context, but can be very useful when it comes to interpreting functions and the like. We&#39;ll cover those later.&lt;/div&gt;
&lt;h3 style=&quot;border-bottom-width: 0px !important; border-color: initial !important; border-left-width: 0px !important; border-right-width: 0px !important; border-style: initial !important; border-top-width: 0px !important; margin-bottom: 1em; margin-left: 0px; margin-right: 0px; margin-top: 1em !important; padding-bottom: 0px; padding-left: 0px; padding-right: 0px; padding-top: 0px;&quot;&gt;

Predicates&lt;/h3&gt;
&lt;div style=&quot;line-height: 1.5em !important; margin-bottom: 1em !important; margin-top: 1em !important; padding-bottom: 0px; padding-left: 0px; padding-right: 0px; padding-top: 0px;&quot;&gt;
All of the ARel &quot;predication&quot; methods can be accessed inside the Squeel DSL, via their method name, an alias, or an an operator, to create ARel predicates, which are used in&amp;nbsp;&lt;code style=&quot;background-color: rgb(248, 248, 255) !important; border-bottom-color: rgb(222, 222, 222) !important; border-bottom-style: solid !important; border-bottom-width: 1px !important; border-left-color: rgb(222, 222, 222) !important; border-left-style: solid !important; border-left-width: 1px !important; border-right-color: rgb(222, 222, 222) !important; border-right-style: solid !important; border-right-width: 1px !important; border-top-color: rgb(222, 222, 222) !important; border-top-style: solid !important; border-top-width: 1px !important; color: rgb(68, 68, 68) !important; font-size: 12px !important; font: normal normal normal 12px/normal &#39;Bitstream Vera Sans Mono&#39;, Courier, monospace; margin-bottom: 0px; margin-left: 0px; margin-right: 0px; margin-top: 0px; padding-bottom: 0px !important; padding-left: 0.2em !important; padding-right: 0.2em !important; padding-top: 0px !important;&quot;&gt;WHERE&lt;/code&gt;&amp;nbsp;or&amp;nbsp;&lt;code style=&quot;background-color: rgb(248, 248, 255) !important; border-bottom-color: rgb(222, 222, 222) !important; border-bottom-style: solid !important; border-bottom-width: 1px !important; border-left-color: rgb(222, 222, 222) !important; border-left-style: solid !important; border-left-width: 1px !important; border-right-color: rgb(222, 222, 222) !important; border-right-style: solid !important; border-right-width: 1px !important; border-top-color: rgb(222, 222, 222) !important; border-top-style: solid !important; border-top-width: 1px !important; color: rgb(68, 68, 68) !important; font-size: 12px !important; font: normal normal normal 12px/normal &#39;Bitstream Vera Sans Mono&#39;, Courier, monospace; margin-bottom: 0px; margin-left: 0px; margin-right: 0px; margin-top: 0px; padding-bottom: 0px !important; padding-left: 0.2em !important; padding-right: 0.2em !important; padding-top: 0px !important;&quot;&gt;HAVING&lt;/code&gt;&amp;nbsp;clauses.&lt;/div&gt;
&lt;table style=&quot;font-size: inherit; margin-bottom: 1em !important; margin-left: 0px !important; margin-right: 0px !important; margin-top: 1em !important; padding-bottom: 0px; padding-left: 0px; padding-right: 0px; padding-top: 0px;&quot;&gt;&lt;tbody style=&quot;margin-bottom: 0px; margin-left: 0px; margin-right: 0px; margin-top: 0px; padding-bottom: 0px; padding-left: 0px; padding-right: 0px; padding-top: 0px;&quot;&gt;
&lt;tr style=&quot;margin-bottom: 0px; margin-left: 0px; margin-right: 0px; margin-top: 0px; padding-bottom: 0px; padding-left: 0px; padding-right: 0px; padding-top: 0px;&quot;&gt;&lt;th style=&quot;border-bottom-color: rgb(187, 187, 187) !important; border-bottom-style: solid !important; border-bottom-width: 1px !important; margin-bottom: 0px; margin-left: 0px; margin-right: 0px; margin-top: 0px; padding-bottom: 0.2em !important; padding-left: 1em !important; padding-right: 1em !important; padding-top: 0.2em !important;&quot;&gt;SQL&lt;/th&gt;&lt;th style=&quot;border-bottom-color: rgb(187, 187, 187) !important; border-bottom-style: solid !important; border-bottom-width: 1px !important; margin-bottom: 0px; margin-left: 0px; margin-right: 0px; margin-top: 0px; padding-bottom: 0.2em !important; padding-left: 1em !important; padding-right: 1em !important; padding-top: 0.2em !important;&quot;&gt;Predication&lt;/th&gt;&lt;th style=&quot;border-bottom-color: rgb(187, 187, 187) !important; border-bottom-style: solid !important; border-bottom-width: 1px !important; margin-bottom: 0px; margin-left: 0px; margin-right: 0px; margin-top: 0px; padding-bottom: 0.2em !important; padding-left: 1em !important; padding-right: 1em !important; padding-top: 0.2em !important;&quot;&gt;Operator&lt;/th&gt;&lt;th style=&quot;border-bottom-color: rgb(187, 187, 187) !important; border-bottom-style: solid !important; border-bottom-width: 1px !important; margin-bottom: 0px; margin-left: 0px; margin-right: 0px; margin-top: 0px; padding-bottom: 0.2em !important; padding-left: 1em !important; padding-right: 1em !important; padding-top: 0.2em !important;&quot;&gt;Alias&lt;/th&gt;&lt;/tr&gt;
&lt;tr style=&quot;margin-bottom: 0px; margin-left: 0px; margin-right: 0px; margin-top: 0px; padding-bottom: 0px; padding-left: 0px; padding-right: 0px; padding-top: 0px;&quot;&gt;&lt;td style=&quot;border-bottom-color: rgb(221, 221, 221) !important; border-bottom-style: solid !important; border-bottom-width: 1px !important; margin-bottom: 0px; margin-left: 0px; margin-right: 0px; margin-top: 0px; padding-bottom: 0.2em !important; padding-left: 1em !important; padding-right: 1em !important; padding-top: 0.2em !important;&quot;&gt;=&lt;/td&gt;&lt;td style=&quot;border-bottom-color: rgb(221, 221, 221) !important; border-bottom-style: solid !important; border-bottom-width: 1px !important; margin-bottom: 0px; margin-left: 0px; margin-right: 0px; margin-top: 0px; padding-bottom: 0.2em !important; padding-left: 1em !important; padding-right: 1em !important; padding-top: 0.2em !important;&quot;&gt;eq&lt;/td&gt;&lt;td style=&quot;border-bottom-color: rgb(221, 221, 221) !important; border-bottom-style: solid !important; border-bottom-width: 1px !important; margin-bottom: 0px; margin-left: 0px; margin-right: 0px; margin-top: 0px; padding-bottom: 0.2em !important; padding-left: 1em !important; padding-right: 1em !important; padding-top: 0.2em !important;&quot;&gt;==&lt;/td&gt;&lt;td style=&quot;border-bottom-color: rgb(221, 221, 221) !important; border-bottom-style: solid !important; border-bottom-width: 1px !important; margin-bottom: 0px; margin-left: 0px; margin-right: 0px; margin-top: 0px; padding-bottom: 0.2em !important; padding-left: 1em !important; padding-right: 1em !important; padding-top: 0.2em !important;&quot;&gt;&lt;/td&gt;&lt;/tr&gt;
&lt;tr style=&quot;margin-bottom: 0px; margin-left: 0px; margin-right: 0px; margin-top: 0px; padding-bottom: 0px; padding-left: 0px; padding-right: 0px; padding-top: 0px;&quot;&gt;&lt;td style=&quot;border-bottom-color: rgb(221, 221, 221) !important; border-bottom-style: solid !important; border-bottom-width: 1px !important; margin-bottom: 0px; margin-left: 0px; margin-right: 0px; margin-top: 0px; padding-bottom: 0.2em !important; padding-left: 1em !important; padding-right: 1em !important; padding-top: 0.2em !important;&quot;&gt;!=&lt;/td&gt;&lt;td style=&quot;border-bottom-color: rgb(221, 221, 221) !important; border-bottom-style: solid !important; border-bottom-width: 1px !important; margin-bottom: 0px; margin-left: 0px; margin-right: 0px; margin-top: 0px; padding-bottom: 0.2em !important; padding-left: 1em !important; padding-right: 1em !important; padding-top: 0.2em !important;&quot;&gt;not_eq&lt;/td&gt;&lt;td style=&quot;border-bottom-color: rgb(221, 221, 221) !important; border-bottom-style: solid !important; border-bottom-width: 1px !important; margin-bottom: 0px; margin-left: 0px; margin-right: 0px; margin-top: 0px; padding-bottom: 0.2em !important; padding-left: 1em !important; padding-right: 1em !important; padding-top: 0.2em !important;&quot;&gt;!= (1.9 only), ^ (1.8)&lt;/td&gt;&lt;td style=&quot;border-bottom-color: rgb(221, 221, 221) !important; border-bottom-style: solid !important; border-bottom-width: 1px !important; margin-bottom: 0px; margin-left: 0px; margin-right: 0px; margin-top: 0px; padding-bottom: 0.2em !important; padding-left: 1em !important; padding-right: 1em !important; padding-top: 0.2em !important;&quot;&gt;&lt;/td&gt;&lt;/tr&gt;
&lt;tr style=&quot;margin-bottom: 0px; margin-left: 0px; margin-right: 0px; margin-top: 0px; padding-bottom: 0px; padding-left: 0px; padding-right: 0px; padding-top: 0px;&quot;&gt;&lt;td style=&quot;border-bottom-color: rgb(221, 221, 221) !important; border-bottom-style: solid !important; border-bottom-width: 1px !important; margin-bottom: 0px; margin-left: 0px; margin-right: 0px; margin-top: 0px; padding-bottom: 0.2em !important; padding-left: 1em !important; padding-right: 1em !important; padding-top: 0.2em !important;&quot;&gt;LIKE&lt;/td&gt;&lt;td style=&quot;border-bottom-color: rgb(221, 221, 221) !important; border-bottom-style: solid !important; border-bottom-width: 1px !important; margin-bottom: 0px; margin-left: 0px; margin-right: 0px; margin-top: 0px; padding-bottom: 0.2em !important; padding-left: 1em !important; padding-right: 1em !important; padding-top: 0.2em !important;&quot;&gt;matches&lt;/td&gt;&lt;td style=&quot;border-bottom-color: rgb(221, 221, 221) !important; border-bottom-style: solid !important; border-bottom-width: 1px !important; margin-bottom: 0px; margin-left: 0px; margin-right: 0px; margin-top: 0px; padding-bottom: 0.2em !important; padding-left: 1em !important; padding-right: 1em !important; padding-top: 0.2em !important;&quot;&gt;=~&lt;/td&gt;&lt;td style=&quot;border-bottom-color: rgb(221, 221, 221) !important; border-bottom-style: solid !important; border-bottom-width: 1px !important; margin-bottom: 0px; margin-left: 0px; margin-right: 0px; margin-top: 0px; padding-bottom: 0.2em !important; padding-left: 1em !important; padding-right: 1em !important; padding-top: 0.2em !important;&quot;&gt;like&lt;/td&gt;&lt;/tr&gt;
&lt;tr style=&quot;margin-bottom: 0px; margin-left: 0px; margin-right: 0px; margin-top: 0px; padding-bottom: 0px; padding-left: 0px; padding-right: 0px; padding-top: 0px;&quot;&gt;&lt;td style=&quot;border-bottom-color: rgb(221, 221, 221) !important; border-bottom-style: solid !important; border-bottom-width: 1px !important; margin-bottom: 0px; margin-left: 0px; margin-right: 0px; margin-top: 0px; padding-bottom: 0.2em !important; padding-left: 1em !important; padding-right: 1em !important; padding-top: 0.2em !important;&quot;&gt;NOT LIKE&lt;/td&gt;&lt;td style=&quot;border-bottom-color: rgb(221, 221, 221) !important; border-bottom-style: solid !important; border-bottom-width: 1px !important; margin-bottom: 0px; margin-left: 0px; margin-right: 0px; margin-top: 0px; padding-bottom: 0.2em !important; padding-left: 1em !important; padding-right: 1em !important; padding-top: 0.2em !important;&quot;&gt;does_not_match&lt;/td&gt;&lt;td style=&quot;border-bottom-color: rgb(221, 221, 221) !important; border-bottom-style: solid !important; border-bottom-width: 1px !important; margin-bottom: 0px; margin-left: 0px; margin-right: 0px; margin-top: 0px; padding-bottom: 0.2em !important; padding-left: 1em !important; padding-right: 1em !important; padding-top: 0.2em !important;&quot;&gt;!~ (1.9 only)&lt;/td&gt;&lt;td style=&quot;border-bottom-color: rgb(221, 221, 221) !important; border-bottom-style: solid !important; border-bottom-width: 1px !important; margin-bottom: 0px; margin-left: 0px; margin-right: 0px; margin-top: 0px; padding-bottom: 0.2em !important; padding-left: 1em !important; padding-right: 1em !important; padding-top: 0.2em !important;&quot;&gt;not_like&lt;/td&gt;&lt;/tr&gt;
&lt;tr style=&quot;margin-bottom: 0px; margin-left: 0px; margin-right: 0px; margin-top: 0px; padding-bottom: 0px; padding-left: 0px; padding-right: 0px; padding-top: 0px;&quot;&gt;&lt;td style=&quot;border-bottom-color: rgb(221, 221, 221) !important; border-bottom-style: solid !important; border-bottom-width: 1px !important; margin-bottom: 0px; margin-left: 0px; margin-right: 0px; margin-top: 0px; padding-bottom: 0.2em !important; padding-left: 1em !important; padding-right: 1em !important; padding-top: 0.2em !important;&quot;&gt;&amp;lt;&lt;/td&gt;&lt;td style=&quot;border-bottom-color: rgb(221, 221, 221) !important; border-bottom-style: solid !important; border-bottom-width: 1px !important; margin-bottom: 0px; margin-left: 0px; margin-right: 0px; margin-top: 0px; padding-bottom: 0.2em !important; padding-left: 1em !important; padding-right: 1em !important; padding-top: 0.2em !important;&quot;&gt;lt&lt;/td&gt;&lt;td style=&quot;border-bottom-color: rgb(221, 221, 221) !important; border-bottom-style: solid !important; border-bottom-width: 1px !important; margin-bottom: 0px; margin-left: 0px; margin-right: 0px; margin-top: 0px; padding-bottom: 0.2em !important; padding-left: 1em !important; padding-right: 1em !important; padding-top: 0.2em !important;&quot;&gt;&amp;lt;&lt;/td&gt;&lt;td style=&quot;border-bottom-color: rgb(221, 221, 221) !important; border-bottom-style: solid !important; border-bottom-width: 1px !important; margin-bottom: 0px; margin-left: 0px; margin-right: 0px; margin-top: 0px; padding-bottom: 0.2em !important; padding-left: 1em !important; padding-right: 1em !important; padding-top: 0.2em !important;&quot;&gt;&lt;/td&gt;&lt;/tr&gt;
&lt;tr style=&quot;margin-bottom: 0px; margin-left: 0px; margin-right: 0px; margin-top: 0px; padding-bottom: 0px; padding-left: 0px; padding-right: 0px; padding-top: 0px;&quot;&gt;&lt;td style=&quot;border-bottom-color: rgb(221, 221, 221) !important; border-bottom-style: solid !important; border-bottom-width: 1px !important; margin-bottom: 0px; margin-left: 0px; margin-right: 0px; margin-top: 0px; padding-bottom: 0.2em !important; padding-left: 1em !important; padding-right: 1em !important; padding-top: 0.2em !important;&quot;&gt;&amp;lt;=&lt;/td&gt;&lt;td style=&quot;border-bottom-color: rgb(221, 221, 221) !important; border-bottom-style: solid !important; border-bottom-width: 1px !important; margin-bottom: 0px; margin-left: 0px; margin-right: 0px; margin-top: 0px; padding-bottom: 0.2em !important; padding-left: 1em !important; padding-right: 1em !important; padding-top: 0.2em !important;&quot;&gt;lteq&lt;/td&gt;&lt;td style=&quot;border-bottom-color: rgb(221, 221, 221) !important; border-bottom-style: solid !important; border-bottom-width: 1px !important; margin-bottom: 0px; margin-left: 0px; margin-right: 0px; margin-top: 0px; padding-bottom: 0.2em !important; padding-left: 1em !important; padding-right: 1em !important; padding-top: 0.2em !important;&quot;&gt;&amp;lt;=&lt;/td&gt;&lt;td style=&quot;border-bottom-color: rgb(221, 221, 221) !important; border-bottom-style: solid !important; border-bottom-width: 1px !important; margin-bottom: 0px; margin-left: 0px; margin-right: 0px; margin-top: 0px; padding-bottom: 0.2em !important; padding-left: 1em !important; padding-right: 1em !important; padding-top: 0.2em !important;&quot;&gt;lte&lt;/td&gt;&lt;/tr&gt;
&lt;tr style=&quot;margin-bottom: 0px; margin-left: 0px; margin-right: 0px; margin-top: 0px; padding-bottom: 0px; padding-left: 0px; padding-right: 0px; padding-top: 0px;&quot;&gt;&lt;td style=&quot;border-bottom-color: rgb(221, 221, 221) !important; border-bottom-style: solid !important; border-bottom-width: 1px !important; margin-bottom: 0px; margin-left: 0px; margin-right: 0px; margin-top: 0px; padding-bottom: 0.2em !important; padding-left: 1em !important; padding-right: 1em !important; padding-top: 0.2em !important;&quot;&gt;&amp;gt;&lt;/td&gt;&lt;td style=&quot;border-bottom-color: rgb(221, 221, 221) !important; border-bottom-style: solid !important; border-bottom-width: 1px !important; margin-bottom: 0px; margin-left: 0px; margin-right: 0px; margin-top: 0px; padding-bottom: 0.2em !important; padding-left: 1em !important; padding-right: 1em !important; padding-top: 0.2em !important;&quot;&gt;gt&lt;/td&gt;&lt;td style=&quot;border-bottom-color: rgb(221, 221, 221) !important; border-bottom-style: solid !important; border-bottom-width: 1px !important; margin-bottom: 0px; margin-left: 0px; margin-right: 0px; margin-top: 0px; padding-bottom: 0.2em !important; padding-left: 1em !important; padding-right: 1em !important; padding-top: 0.2em !important;&quot;&gt;&amp;gt;&lt;/td&gt;&lt;td style=&quot;border-bottom-color: rgb(221, 221, 221) !important; border-bottom-style: solid !important; border-bottom-width: 1px !important; margin-bottom: 0px; margin-left: 0px; margin-right: 0px; margin-top: 0px; padding-bottom: 0.2em !important; padding-left: 1em !important; padding-right: 1em !important; padding-top: 0.2em !important;&quot;&gt;&lt;/td&gt;&lt;/tr&gt;
&lt;tr style=&quot;margin-bottom: 0px; margin-left: 0px; margin-right: 0px; margin-top: 0px; padding-bottom: 0px; padding-left: 0px; padding-right: 0px; padding-top: 0px;&quot;&gt;&lt;td style=&quot;border-bottom-color: rgb(221, 221, 221) !important; border-bottom-style: solid !important; border-bottom-width: 1px !important; margin-bottom: 0px; margin-left: 0px; margin-right: 0px; margin-top: 0px; padding-bottom: 0.2em !important; padding-left: 1em !important; padding-right: 1em !important; padding-top: 0.2em !important;&quot;&gt;&amp;gt;=&lt;/td&gt;&lt;td style=&quot;border-bottom-color: rgb(221, 221, 221) !important; border-bottom-style: solid !important; border-bottom-width: 1px !important; margin-bottom: 0px; margin-left: 0px; margin-right: 0px; margin-top: 0px; padding-bottom: 0.2em !important; padding-left: 1em !important; padding-right: 1em !important; padding-top: 0.2em !important;&quot;&gt;gteq&lt;/td&gt;&lt;td style=&quot;border-bottom-color: rgb(221, 221, 221) !important; border-bottom-style: solid !important; border-bottom-width: 1px !important; margin-bottom: 0px; margin-left: 0px; margin-right: 0px; margin-top: 0px; padding-bottom: 0.2em !important; padding-left: 1em !important; padding-right: 1em !important; padding-top: 0.2em !important;&quot;&gt;&amp;gt;=&lt;/td&gt;&lt;td style=&quot;border-bottom-color: rgb(221, 221, 221) !important; border-bottom-style: solid !important; border-bottom-width: 1px !important; margin-bottom: 0px; margin-left: 0px; margin-right: 0px; margin-top: 0px; padding-bottom: 0.2em !important; padding-left: 1em !important; padding-right: 1em !important; padding-top: 0.2em !important;&quot;&gt;gte&lt;/td&gt;&lt;/tr&gt;
&lt;tr style=&quot;margin-bottom: 0px; margin-left: 0px; margin-right: 0px; margin-top: 0px; padding-bottom: 0px; padding-left: 0px; padding-right: 0px; padding-top: 0px;&quot;&gt;&lt;td style=&quot;border-bottom-color: rgb(221, 221, 221) !important; border-bottom-style: solid !important; border-bottom-width: 1px !important; margin-bottom: 0px; margin-left: 0px; margin-right: 0px; margin-top: 0px; padding-bottom: 0.2em !important; padding-left: 1em !important; padding-right: 1em !important; padding-top: 0.2em !important;&quot;&gt;IN&lt;/td&gt;&lt;td style=&quot;border-bottom-color: rgb(221, 221, 221) !important; border-bottom-style: solid !important; border-bottom-width: 1px !important; margin-bottom: 0px; margin-left: 0px; margin-right: 0px; margin-top: 0px; padding-bottom: 0.2em !important; padding-left: 1em !important; padding-right: 1em !important; padding-top: 0.2em !important;&quot;&gt;in&lt;/td&gt;&lt;td style=&quot;border-bottom-color: rgb(221, 221, 221) !important; border-bottom-style: solid !important; border-bottom-width: 1px !important; margin-bottom: 0px; margin-left: 0px; margin-right: 0px; margin-top: 0px; padding-bottom: 0.2em !important; padding-left: 1em !important; padding-right: 1em !important; padding-top: 0.2em !important;&quot;&gt;&amp;gt;&amp;gt;&lt;/td&gt;&lt;td style=&quot;border-bottom-color: rgb(221, 221, 221) !important; border-bottom-style: solid !important; border-bottom-width: 1px !important; margin-bottom: 0px; margin-left: 0px; margin-right: 0px; margin-top: 0px; padding-bottom: 0.2em !important; padding-left: 1em !important; padding-right: 1em !important; padding-top: 0.2em !important;&quot;&gt;&lt;/td&gt;&lt;/tr&gt;
&lt;tr style=&quot;margin-bottom: 0px; margin-left: 0px; margin-right: 0px; margin-top: 0px; padding-bottom: 0px; padding-left: 0px; padding-right: 0px; padding-top: 0px;&quot;&gt;&lt;td style=&quot;border-bottom-color: rgb(221, 221, 221) !important; border-bottom-style: solid !important; border-bottom-width: 1px !important; margin-bottom: 0px; margin-left: 0px; margin-right: 0px; margin-top: 0px; padding-bottom: 0.2em !important; padding-left: 1em !important; padding-right: 1em !important; padding-top: 0.2em !important;&quot;&gt;NOT IN&lt;/td&gt;&lt;td style=&quot;border-bottom-color: rgb(221, 221, 221) !important; border-bottom-style: solid !important; border-bottom-width: 1px !important; margin-bottom: 0px; margin-left: 0px; margin-right: 0px; margin-top: 0px; padding-bottom: 0.2em !important; padding-left: 1em !important; padding-right: 1em !important; padding-top: 0.2em !important;&quot;&gt;not_in&lt;/td&gt;&lt;td style=&quot;border-bottom-color: rgb(221, 221, 221) !important; border-bottom-style: solid !important; border-bottom-width: 1px !important; margin-bottom: 0px; margin-left: 0px; margin-right: 0px; margin-top: 0px; padding-bottom: 0.2em !important; padding-left: 1em !important; padding-right: 1em !important; padding-top: 0.2em !important;&quot;&gt;&amp;lt;&amp;lt;&lt;/td&gt;&lt;td style=&quot;border-bottom-color: rgb(221, 221, 221) !important; border-bottom-style: solid !important; border-bottom-width: 1px !important; margin-bottom: 0px; margin-left: 0px; margin-right: 0px; margin-top: 0px; padding-bottom: 0.2em !important; padding-left: 1em !important; padding-right: 1em !important; padding-top: 0.2em !important;&quot;&gt;&lt;/td&gt;&lt;/tr&gt;
&lt;/tbody&gt;&lt;/table&gt;
&lt;div style=&quot;line-height: 1.5em !important; margin-bottom: 1em !important; margin-top: 1em !important; padding-bottom: 0px; padding-left: 0px; padding-right: 0px; padding-top: 0px;&quot;&gt;
Let&#39;s say we want to generate this simple query:&lt;/div&gt;
&lt;pre style=&quot;-webkit-box-shadow: rgba(0, 0, 0, 0.0664063) 0px 1px 2px inset; background-color: #eeeeee; border-bottom-color: rgb(221, 221, 221); border-bottom-left-radius: 3px 3px; border-bottom-right-radius: 3px 3px; border-bottom-style: solid; border-bottom-width: 1px; border-left-color: rgb(221, 221, 221); border-left-style: solid; border-left-width: 1px; border-right-color: rgb(221, 221, 221); border-right-style: solid; border-right-width: 1px; border-top-color: rgb(221, 221, 221); border-top-left-radius: 3px 3px; border-top-right-radius: 3px 3px; border-top-style: solid; border-top-width: 1px; color: #444444; font-size: 12px; font: normal normal normal 12px/normal &#39;Bitstream Vera Sans Mono&#39;, Courier, monospace; margin-bottom: 1em; margin-top: 1em; overflow-x: auto; overflow-y: auto; padding-bottom: 5px; padding-left: 5px; padding-right: 5px; padding-top: 5px;&quot;&gt;&lt;code style=&quot;background-color: rgb(238, 238, 238) !important; border-bottom-color: rgb(222, 222, 222) !important; border-bottom-style: none !important; border-bottom-width: 1px !important; border-color: initial !important; border-left-color: rgb(222, 222, 222) !important; border-left-style: none !important; border-left-width: 1px !important; border-right-color: rgb(222, 222, 222) !important; border-right-style: none !important; border-right-width: 1px !important; border-top-color: rgb(222, 222, 222) !important; border-top-style: none !important; border-top-width: 1px !important; border-width: initial !important; color: rgb(68, 68, 68) !important; font-size: 12px !important; font: normal normal normal 12px/normal &#39;Bitstream Vera Sans Mono&#39;, Courier, monospace; margin-bottom: 0px; margin-left: 0px; margin-right: 0px; margin-top: 0px; padding-bottom: 0px !important; padding-left: 0px !important; padding-right: 0px !important; padding-top: 0px !important;&quot;&gt;SELECT &quot;people&quot;.* FROM people WHERE &quot;people&quot;.&quot;name&quot; = &#39;Joe Blow&#39;
&lt;/code&gt;&lt;/pre&gt;
&lt;div style=&quot;line-height: 1.5em !important; margin-bottom: 1em !important; margin-top: 1em !important; padding-bottom: 0px; padding-left: 0px; padding-right: 0px; padding-top: 0px;&quot;&gt;
All of the following will generate the above SQL:&lt;/div&gt;
&lt;pre style=&quot;-webkit-box-shadow: rgba(0, 0, 0, 0.0664063) 0px 1px 2px inset; background-color: #eeeeee; border-bottom-color: rgb(221, 221, 221); border-bottom-left-radius: 3px 3px; border-bottom-right-radius: 3px 3px; border-bottom-style: solid; border-bottom-width: 1px; border-left-color: rgb(221, 221, 221); border-left-style: solid; border-left-width: 1px; border-right-color: rgb(221, 221, 221); border-right-style: solid; border-right-width: 1px; border-top-color: rgb(221, 221, 221); border-top-left-radius: 3px 3px; border-top-right-radius: 3px 3px; border-top-style: solid; border-top-width: 1px; color: #444444; font-size: 12px; font: normal normal normal 12px/normal &#39;Bitstream Vera Sans Mono&#39;, Courier, monospace; margin-bottom: 1em; margin-top: 1em; overflow-x: auto; overflow-y: auto; padding-bottom: 5px; padding-left: 5px; padding-right: 5px; padding-top: 5px;&quot;&gt;&lt;code style=&quot;background-color: rgb(238, 238, 238) !important; border-bottom-color: rgb(222, 222, 222) !important; border-bottom-style: none !important; border-bottom-width: 1px !important; border-color: initial !important; border-left-color: rgb(222, 222, 222) !important; border-left-style: none !important; border-left-width: 1px !important; border-right-color: rgb(222, 222, 222) !important; border-right-style: none !important; border-right-width: 1px !important; border-top-color: rgb(222, 222, 222) !important; border-top-style: none !important; border-top-width: 1px !important; border-width: initial !important; color: rgb(68, 68, 68) !important; font-size: 12px !important; font: normal normal normal 12px/normal &#39;Bitstream Vera Sans Mono&#39;, Courier, monospace; margin-bottom: 0px; margin-left: 0px; margin-right: 0px; margin-top: 0px; padding-bottom: 0px !important; padding-left: 0px !important; padding-right: 0px !important; padding-top: 0px !important;&quot;&gt;Person.where(:name =&amp;gt; &#39;Joe Blow&#39;)
Person.where{{name =&amp;gt; &#39;Joe Blow&#39;}}
Person.where{{name.eq =&amp;gt; &#39;Joe Blow&#39;}}
Person.where{name.eq &#39;Joe Blow&#39;}
Person.where{name == &#39;Joe Blow&#39;}
&lt;/code&gt;&lt;/pre&gt;
&lt;div style=&quot;line-height: 1.5em !important; margin-bottom: 1em !important; margin-top: 1em !important; padding-bottom: 0px; padding-left: 0px; padding-right: 0px; padding-top: 0px;&quot;&gt;
Not a very exciting example since equality is handled just fine via the first example in standard ActiveRecord. But consider the following query:&lt;/div&gt;
&lt;pre style=&quot;-webkit-box-shadow: rgba(0, 0, 0, 0.0664063) 0px 1px 2px inset; background-color: #eeeeee; border-bottom-color: rgb(221, 221, 221); border-bottom-left-radius: 3px 3px; border-bottom-right-radius: 3px 3px; border-bottom-style: solid; border-bottom-width: 1px; border-left-color: rgb(221, 221, 221); border-left-style: solid; border-left-width: 1px; border-right-color: rgb(221, 221, 221); border-right-style: solid; border-right-width: 1px; border-top-color: rgb(221, 221, 221); border-top-left-radius: 3px 3px; border-top-right-radius: 3px 3px; border-top-style: solid; border-top-width: 1px; color: #444444; font-size: 12px; font: normal normal normal 12px/normal &#39;Bitstream Vera Sans Mono&#39;, Courier, monospace; margin-bottom: 1em; margin-top: 1em; overflow-x: auto; overflow-y: auto; padding-bottom: 5px; padding-left: 5px; padding-right: 5px; padding-top: 5px;&quot;&gt;&lt;code style=&quot;background-color: rgb(238, 238, 238) !important; border-bottom-color: rgb(222, 222, 222) !important; border-bottom-style: none !important; border-bottom-width: 1px !important; border-color: initial !important; border-left-color: rgb(222, 222, 222) !important; border-left-style: none !important; border-left-width: 1px !important; border-right-color: rgb(222, 222, 222) !important; border-right-style: none !important; border-right-width: 1px !important; border-top-color: rgb(222, 222, 222) !important; border-top-style: none !important; border-top-width: 1px !important; border-width: initial !important; color: rgb(68, 68, 68) !important; font-size: 12px !important; font: normal normal normal 12px/normal &#39;Bitstream Vera Sans Mono&#39;, Courier, monospace; margin-bottom: 0px; margin-left: 0px; margin-right: 0px; margin-top: 0px; padding-bottom: 0px !important; padding-left: 0px !important; padding-right: 0px !important; padding-top: 0px !important;&quot;&gt;SELECT &quot;people&quot;.* FROM people
WHERE (&quot;people&quot;.&quot;name&quot; LIKE &#39;Ernie%&#39; AND &quot;people&quot;.&quot;salary&quot; &amp;lt; 50000)
  OR  (&quot;people&quot;.&quot;name&quot; LIKE &#39;Joe%&#39; AND &quot;people&quot;.&quot;salary&quot; &amp;gt; 100000)
&lt;/code&gt;&lt;/pre&gt;
&lt;div style=&quot;line-height: 1.5em !important; margin-bottom: 1em !important; margin-top: 1em !important; padding-bottom: 0px; padding-left: 0px; padding-right: 0px; padding-top: 0px;&quot;&gt;
To do this with standard ActiveRecord, we&#39;d do something like:&lt;/div&gt;
&lt;pre style=&quot;-webkit-box-shadow: rgba(0, 0, 0, 0.0664063) 0px 1px 2px inset; background-color: #eeeeee; border-bottom-color: rgb(221, 221, 221); border-bottom-left-radius: 3px 3px; border-bottom-right-radius: 3px 3px; border-bottom-style: solid; border-bottom-width: 1px; border-left-color: rgb(221, 221, 221); border-left-style: solid; border-left-width: 1px; border-right-color: rgb(221, 221, 221); border-right-style: solid; border-right-width: 1px; border-top-color: rgb(221, 221, 221); border-top-left-radius: 3px 3px; border-top-right-radius: 3px 3px; border-top-style: solid; border-top-width: 1px; color: #444444; font-size: 12px; font: normal normal normal 12px/normal &#39;Bitstream Vera Sans Mono&#39;, Courier, monospace; margin-bottom: 1em; margin-top: 1em; overflow-x: auto; overflow-y: auto; padding-bottom: 5px; padding-left: 5px; padding-right: 5px; padding-top: 5px;&quot;&gt;&lt;code style=&quot;background-color: rgb(238, 238, 238) !important; border-bottom-color: rgb(222, 222, 222) !important; border-bottom-style: none !important; border-bottom-width: 1px !important; border-color: initial !important; border-left-color: rgb(222, 222, 222) !important; border-left-style: none !important; border-left-width: 1px !important; border-right-color: rgb(222, 222, 222) !important; border-right-style: none !important; border-right-width: 1px !important; border-top-color: rgb(222, 222, 222) !important; border-top-style: none !important; border-top-width: 1px !important; border-width: initial !important; color: rgb(68, 68, 68) !important; font-size: 12px !important; font: normal normal normal 12px/normal &#39;Bitstream Vera Sans Mono&#39;, Courier, monospace; margin-bottom: 0px; margin-left: 0px; margin-right: 0px; margin-top: 0px; padding-bottom: 0px !important; padding-left: 0px !important; padding-right: 0px !important; padding-top: 0px !important;&quot;&gt;Person.where(
  &#39;(name LIKE ? AND salary &amp;lt; ?) OR (name LIKE ? AND salary &amp;gt; ?)&#39;,
  &#39;Ernie%&#39;, 50000, &#39;Joe%&#39;, 100000
)
&lt;/code&gt;&lt;/pre&gt;
&lt;div style=&quot;line-height: 1.5em !important; margin-bottom: 1em !important; margin-top: 1em !important; padding-bottom: 0px; padding-left: 0px; padding-right: 0px; padding-top: 0px;&quot;&gt;
With Squeel:&lt;/div&gt;
&lt;pre style=&quot;-webkit-box-shadow: rgba(0, 0, 0, 0.0664063) 0px 1px 2px inset; background-color: #eeeeee; border-bottom-color: rgb(221, 221, 221); border-bottom-left-radius: 3px 3px; border-bottom-right-radius: 3px 3px; border-bottom-style: solid; border-bottom-width: 1px; border-left-color: rgb(221, 221, 221); border-left-style: solid; border-left-width: 1px; border-right-color: rgb(221, 221, 221); border-right-style: solid; border-right-width: 1px; border-top-color: rgb(221, 221, 221); border-top-left-radius: 3px 3px; border-top-right-radius: 3px 3px; border-top-style: solid; border-top-width: 1px; color: #444444; font-size: 12px; font: normal normal normal 12px/normal &#39;Bitstream Vera Sans Mono&#39;, Courier, monospace; margin-bottom: 1em; margin-top: 1em; overflow-x: auto; overflow-y: auto; padding-bottom: 5px; padding-left: 5px; padding-right: 5px; padding-top: 5px;&quot;&gt;&lt;code style=&quot;background-color: rgb(238, 238, 238) !important; border-bottom-color: rgb(222, 222, 222) !important; border-bottom-style: none !important; border-bottom-width: 1px !important; border-color: initial !important; border-left-color: rgb(222, 222, 222) !important; border-left-style: none !important; border-left-width: 1px !important; border-right-color: rgb(222, 222, 222) !important; border-right-style: none !important; border-right-width: 1px !important; border-top-color: rgb(222, 222, 222) !important; border-top-style: none !important; border-top-width: 1px !important; border-width: initial !important; color: rgb(68, 68, 68) !important; font-size: 12px !important; font: normal normal normal 12px/normal &#39;Bitstream Vera Sans Mono&#39;, Courier, monospace; margin-bottom: 0px; margin-left: 0px; margin-right: 0px; margin-top: 0px; padding-bottom: 0px !important; padding-left: 0px !important; padding-right: 0px !important; padding-top: 0px !important;&quot;&gt;Person.where{(name =~ &#39;Ernie%&#39;) &amp;amp; (salary &amp;lt; 50000) | (name =~ &#39;Joe%&#39;) &amp;amp; (salary &amp;gt; 100000)}
&lt;/code&gt;&lt;/pre&gt;
&lt;div style=&quot;line-height: 1.5em !important; margin-bottom: 1em !important; margin-top: 1em !important; padding-bottom: 0px; padding-left: 0px; padding-right: 0px; padding-top: 0px;&quot;&gt;
Here, we&#39;re using&amp;nbsp;&lt;code style=&quot;background-color: rgb(248, 248, 255) !important; border-bottom-color: rgb(222, 222, 222) !important; border-bottom-style: solid !important; border-bottom-width: 1px !important; border-left-color: rgb(222, 222, 222) !important; border-left-style: solid !important; border-left-width: 1px !important; border-right-color: rgb(222, 222, 222) !important; border-right-style: solid !important; border-right-width: 1px !important; border-top-color: rgb(222, 222, 222) !important; border-top-style: solid !important; border-top-width: 1px !important; color: rgb(68, 68, 68) !important; font-size: 12px !important; font: normal normal normal 12px/normal &#39;Bitstream Vera Sans Mono&#39;, Courier, monospace; margin-bottom: 0px; margin-left: 0px; margin-right: 0px; margin-top: 0px; padding-bottom: 0px !important; padding-left: 0.2em !important; padding-right: 0.2em !important; padding-top: 0px !important;&quot;&gt;&amp;amp;&lt;/code&gt;&amp;nbsp;and&amp;nbsp;&lt;code style=&quot;background-color: rgb(248, 248, 255) !important; border-bottom-color: rgb(222, 222, 222) !important; border-bottom-style: solid !important; border-bottom-width: 1px !important; border-left-color: rgb(222, 222, 222) !important; border-left-style: solid !important; border-left-width: 1px !important; border-right-color: rgb(222, 222, 222) !important; border-right-style: solid !important; border-right-width: 1px !important; border-top-color: rgb(222, 222, 222) !important; border-top-style: solid !important; border-top-width: 1px !important; color: rgb(68, 68, 68) !important; font-size: 12px !important; font: normal normal normal 12px/normal &#39;Bitstream Vera Sans Mono&#39;, Courier, monospace; margin-bottom: 0px; margin-left: 0px; margin-right: 0px; margin-top: 0px; padding-bottom: 0px !important; padding-left: 0.2em !important; padding-right: 0.2em !important; padding-top: 0px !important;&quot;&gt;|&lt;/code&gt;&amp;nbsp;to generate&amp;nbsp;&lt;code style=&quot;background-color: rgb(248, 248, 255) !important; border-bottom-color: rgb(222, 222, 222) !important; border-bottom-style: solid !important; border-bottom-width: 1px !important; border-left-color: rgb(222, 222, 222) !important; border-left-style: solid !important; border-left-width: 1px !important; border-right-color: rgb(222, 222, 222) !important; border-right-style: solid !important; border-right-width: 1px !important; border-top-color: rgb(222, 222, 222) !important; border-top-style: solid !important; border-top-width: 1px !important; color: rgb(68, 68, 68) !important; font-size: 12px !important; font: normal normal normal 12px/normal &#39;Bitstream Vera Sans Mono&#39;, Courier, monospace; margin-bottom: 0px; margin-left: 0px; margin-right: 0px; margin-top: 0px; padding-bottom: 0px !important; padding-left: 0.2em !important; padding-right: 0.2em !important; padding-top: 0px !important;&quot;&gt;AND&lt;/code&gt;&amp;nbsp;and&amp;nbsp;&lt;code style=&quot;background-color: rgb(248, 248, 255) !important; border-bottom-color: rgb(222, 222, 222) !important; border-bottom-style: solid !important; border-bottom-width: 1px !important; border-left-color: rgb(222, 222, 222) !important; border-left-style: solid !important; border-left-width: 1px !important; border-right-color: rgb(222, 222, 222) !important; border-right-style: solid !important; border-right-width: 1px !important; border-top-color: rgb(222, 222, 222) !important; border-top-style: solid !important; border-top-width: 1px !important; color: rgb(68, 68, 68) !important; font-size: 12px !important; font: normal normal normal 12px/normal &#39;Bitstream Vera Sans Mono&#39;, Courier, monospace; margin-bottom: 0px; margin-left: 0px; margin-right: 0px; margin-top: 0px; padding-bottom: 0px !important; padding-left: 0.2em !important; padding-right: 0.2em !important; padding-top: 0px !important;&quot;&gt;OR&lt;/code&gt;, respectively.&lt;/div&gt;
&lt;div style=&quot;line-height: 1.5em !important; margin-bottom: 1em !important; margin-top: 1em !important; padding-bottom: 0px; padding-left: 0px; padding-right: 0px; padding-top: 0px;&quot;&gt;
There are two obvious but important differences between these two code samples, and both of them have to do with&amp;nbsp;&lt;i style=&quot;margin-bottom: 0px; margin-left: 0px; margin-right: 0px; margin-top: 0px; padding-bottom: 0px; padding-left: 0px; padding-right: 0px; padding-top: 0px;&quot;&gt;context&lt;/i&gt;.&lt;/div&gt;
&lt;ol style=&quot;margin-bottom: 1em !important; margin-left: 2em !important; margin-right: 0px !important; margin-top: 1em !important; padding-bottom: 0px; padding-left: 0px; padding-right: 0px; padding-top: 0px;&quot;&gt;
&lt;li style=&quot;margin-bottom: 0.5em; margin-left: 0px; margin-right: 0px; margin-top: 0.5em; padding-bottom: 0px; padding-left: 0px; padding-right: 0px; padding-top: 0px;&quot;&gt;&lt;div style=&quot;line-height: 1.5em !important; margin-bottom: 1em !important; margin-top: 1em !important; padding-bottom: 0px; padding-left: 0px; padding-right: 0px; padding-top: 0px;&quot;&gt;
To read code with SQL interpolation, the structure of the SQL query must first be considered, then we must cross-reference the values to be substituted with their placeholders. This carries with it a small but perceptible (and annoying!) context shift during which we stop thinking about the comparison being performed, and instead play &quot;count the arguments&quot;, or, in the case of named/hash interpolations, &quot;find the word&quot;. The Squeel syntax places both sides of each comparison in proximity to one another, allowing us to focus on what our code is doing.&lt;/div&gt;
&lt;/li&gt;
&lt;li style=&quot;margin-bottom: 0.5em; margin-left: 0px; margin-right: 0px; margin-top: 0.5em; padding-bottom: 0px; padding-left: 0px; padding-right: 0px; padding-top: 0px;&quot;&gt;&lt;div style=&quot;line-height: 1.5em !important; margin-bottom: 1em !important; margin-top: 1em !important; padding-bottom: 0px; padding-left: 0px; padding-right: 0px; padding-top: 0px;&quot;&gt;
In the first example, we&#39;re starting off with Ruby, switching context to SQL, and then back to Ruby, and while we spend time in SQL-land, we&#39;re stuck with SQL syntax, whether or not it&#39;s the best way to express what we&#39;re trying to do. With Squeel, we&#39;re writing Ruby from start to finish. And with Ruby syntax comes flexibility to express the query in the way we see fit.&lt;/div&gt;
&lt;/li&gt;
&lt;/ol&gt;
&lt;h3 style=&quot;border-bottom-width: 0px !important; border-color: initial !important; border-left-width: 0px !important; border-right-width: 0px !important; border-style: initial !important; border-top-width: 0px !important; margin-bottom: 1em; margin-left: 0px; margin-right: 0px; margin-top: 1em !important; padding-bottom: 0px; padding-left: 0px; padding-right: 0px; padding-top: 0px;&quot;&gt;

Predicate aliases&lt;/h3&gt;
&lt;div style=&quot;line-height: 1.5em !important; margin-bottom: 1em !important; margin-top: 1em !important; padding-bottom: 0px; padding-left: 0px; padding-right: 0px; padding-top: 0px;&quot;&gt;
That last bit is important. We can mix and match predicate methods with operators and take advantage of Ruby&#39;s operator precedence or parenthetical grouping to make our intentions more clear, on the first read-through. And if we don&#39;t like the way that the existing predications read, we can create our own aliases in a Squeel configure block:&lt;/div&gt;
&lt;pre style=&quot;-webkit-box-shadow: rgba(0, 0, 0, 0.0664063) 0px 1px 2px inset; background-color: #eeeeee; border-bottom-color: rgb(221, 221, 221); border-bottom-left-radius: 3px 3px; border-bottom-right-radius: 3px 3px; border-bottom-style: solid; border-bottom-width: 1px; border-left-color: rgb(221, 221, 221); border-left-style: solid; border-left-width: 1px; border-right-color: rgb(221, 221, 221); border-right-style: solid; border-right-width: 1px; border-top-color: rgb(221, 221, 221); border-top-left-radius: 3px 3px; border-top-right-radius: 3px 3px; border-top-style: solid; border-top-width: 1px; color: #444444; font-size: 12px; font: normal normal normal 12px/normal &#39;Bitstream Vera Sans Mono&#39;, Courier, monospace; margin-bottom: 1em; margin-top: 1em; overflow-x: auto; overflow-y: auto; padding-bottom: 5px; padding-left: 5px; padding-right: 5px; padding-top: 5px;&quot;&gt;&lt;code style=&quot;background-color: rgb(238, 238, 238) !important; border-bottom-color: rgb(222, 222, 222) !important; border-bottom-style: none !important; border-bottom-width: 1px !important; border-color: initial !important; border-left-color: rgb(222, 222, 222) !important; border-left-style: none !important; border-left-width: 1px !important; border-right-color: rgb(222, 222, 222) !important; border-right-style: none !important; border-right-width: 1px !important; border-top-color: rgb(222, 222, 222) !important; border-top-style: none !important; border-top-width: 1px !important; border-width: initial !important; color: rgb(68, 68, 68) !important; font-size: 12px !important; font: normal normal normal 12px/normal &#39;Bitstream Vera Sans Mono&#39;, Courier, monospace; margin-bottom: 0px; margin-left: 0px; margin-right: 0px; margin-top: 0px; padding-bottom: 0px !important; padding-left: 0px !important; padding-right: 0px !important; padding-top: 0px !important;&quot;&gt;Squeel.configure do |config|
  config.alias_predicate :is_less_than, :lt
end

Person.where{salary.is_less_than 50000}.to_sql
# =&amp;gt; SELECT &quot;people&quot;.* FROM &quot;people&quot;  WHERE &quot;people&quot;.&quot;salary&quot; &amp;lt; 50000
&lt;/code&gt;&lt;/pre&gt;
&lt;div style=&quot;line-height: 1.5em !important; margin-bottom: 1em !important; margin-top: 1em !important; padding-bottom: 0px; padding-left: 0px; padding-right: 0px; padding-top: 0px;&quot;&gt;
And while we&#39;re on the topic of helping you make your code more expressive...&lt;/div&gt;
&lt;h3 style=&quot;border-bottom-width: 0px !important; border-color: initial !important; border-left-width: 0px !important; border-right-width: 0px !important; border-style: initial !important; border-top-width: 0px !important; margin-bottom: 1em; margin-left: 0px; margin-right: 0px; margin-top: 1em !important; padding-bottom: 0px; padding-left: 0px; padding-right: 0px; padding-top: 0px;&quot;&gt;

Compound conditions&lt;/h3&gt;
&lt;div style=&quot;line-height: 1.5em !important; margin-bottom: 1em !important; margin-top: 1em !important; padding-bottom: 0px; padding-left: 0px; padding-right: 0px; padding-top: 0px;&quot;&gt;
Let&#39;s say you want to check if a Person has a name like one of several possibilities.&lt;/div&gt;
&lt;pre style=&quot;-webkit-box-shadow: rgba(0, 0, 0, 0.0664063) 0px 1px 2px inset; background-color: #eeeeee; border-bottom-color: rgb(221, 221, 221); border-bottom-left-radius: 3px 3px; border-bottom-right-radius: 3px 3px; border-bottom-style: solid; border-bottom-width: 1px; border-left-color: rgb(221, 221, 221); border-left-style: solid; border-left-width: 1px; border-right-color: rgb(221, 221, 221); border-right-style: solid; border-right-width: 1px; border-top-color: rgb(221, 221, 221); border-top-left-radius: 3px 3px; border-top-right-radius: 3px 3px; border-top-style: solid; border-top-width: 1px; color: #444444; font-size: 12px; font: normal normal normal 12px/normal &#39;Bitstream Vera Sans Mono&#39;, Courier, monospace; margin-bottom: 1em; margin-top: 1em; overflow-x: auto; overflow-y: auto; padding-bottom: 5px; padding-left: 5px; padding-right: 5px; padding-top: 5px;&quot;&gt;&lt;code style=&quot;background-color: rgb(238, 238, 238) !important; border-bottom-color: rgb(222, 222, 222) !important; border-bottom-style: none !important; border-bottom-width: 1px !important; border-color: initial !important; border-left-color: rgb(222, 222, 222) !important; border-left-style: none !important; border-left-width: 1px !important; border-right-color: rgb(222, 222, 222) !important; border-right-style: none !important; border-right-width: 1px !important; border-top-color: rgb(222, 222, 222) !important; border-top-style: none !important; border-top-width: 1px !important; border-width: initial !important; color: rgb(68, 68, 68) !important; font-size: 12px !important; font: normal normal normal 12px/normal &#39;Bitstream Vera Sans Mono&#39;, Courier, monospace; margin-bottom: 0px; margin-left: 0px; margin-right: 0px; margin-top: 0px; padding-bottom: 0px !important; padding-left: 0px !important; padding-right: 0px !important; padding-top: 0px !important;&quot;&gt;names = [&#39;Ernie%&#39;, &#39;Joe%&#39;, &#39;Mary%&#39;]
Person.where(&#39;name LIKE ? OR name LIKE ? OR name LIKE ?&#39;, *names)
&lt;/code&gt;&lt;/pre&gt;
&lt;div style=&quot;line-height: 1.5em !important; margin-bottom: 1em !important; margin-top: 1em !important; padding-bottom: 0px; padding-left: 0px; padding-right: 0px; padding-top: 0px;&quot;&gt;
But you&#39;re smart, and you know that you might want to check more or less than 3 names, so you make your query flexible:&lt;/div&gt;
&lt;pre style=&quot;-webkit-box-shadow: rgba(0, 0, 0, 0.0664063) 0px 1px 2px inset; background-color: #eeeeee; border-bottom-color: rgb(221, 221, 221); border-bottom-left-radius: 3px 3px; border-bottom-right-radius: 3px 3px; border-bottom-style: solid; border-bottom-width: 1px; border-left-color: rgb(221, 221, 221); border-left-style: solid; border-left-width: 1px; border-right-color: rgb(221, 221, 221); border-right-style: solid; border-right-width: 1px; border-top-color: rgb(221, 221, 221); border-top-left-radius: 3px 3px; border-top-right-radius: 3px 3px; border-top-style: solid; border-top-width: 1px; color: #444444; font-size: 12px; font: normal normal normal 12px/normal &#39;Bitstream Vera Sans Mono&#39;, Courier, monospace; margin-bottom: 1em; margin-top: 1em; overflow-x: auto; overflow-y: auto; padding-bottom: 5px; padding-left: 5px; padding-right: 5px; padding-top: 5px;&quot;&gt;&lt;code style=&quot;background-color: rgb(238, 238, 238) !important; border-bottom-color: rgb(222, 222, 222) !important; border-bottom-style: none !important; border-bottom-width: 1px !important; border-color: initial !important; border-left-color: rgb(222, 222, 222) !important; border-left-style: none !important; border-left-width: 1px !important; border-right-color: rgb(222, 222, 222) !important; border-right-style: none !important; border-right-width: 1px !important; border-top-color: rgb(222, 222, 222) !important; border-top-style: none !important; border-top-width: 1px !important; border-width: initial !important; color: rgb(68, 68, 68) !important; font-size: 12px !important; font: normal normal normal 12px/normal &#39;Bitstream Vera Sans Mono&#39;, Courier, monospace; margin-bottom: 0px; margin-left: 0px; margin-right: 0px; margin-top: 0px; padding-bottom: 0px !important; padding-left: 0px !important; padding-right: 0px !important; padding-top: 0px !important;&quot;&gt;Person.where(([&#39;name LIKE ?&#39;] * names.size).join(&#39; OR &#39;), *names)
&lt;/code&gt;&lt;/pre&gt;
&lt;div style=&quot;line-height: 1.5em !important; margin-bottom: 1em !important; margin-top: 1em !important; padding-bottom: 0px; padding-left: 0px; padding-right: 0px; padding-top: 0px;&quot;&gt;
Yeah... that&#39;s readable, all right. How about:&lt;/div&gt;
&lt;pre style=&quot;-webkit-box-shadow: rgba(0, 0, 0, 0.0664063) 0px 1px 2px inset; background-color: #eeeeee; border-bottom-color: rgb(221, 221, 221); border-bottom-left-radius: 3px 3px; border-bottom-right-radius: 3px 3px; border-bottom-style: solid; border-bottom-width: 1px; border-left-color: rgb(221, 221, 221); border-left-style: solid; border-left-width: 1px; border-right-color: rgb(221, 221, 221); border-right-style: solid; border-right-width: 1px; border-top-color: rgb(221, 221, 221); border-top-left-radius: 3px 3px; border-top-right-radius: 3px 3px; border-top-style: solid; border-top-width: 1px; color: #444444; font-size: 12px; font: normal normal normal 12px/normal &#39;Bitstream Vera Sans Mono&#39;, Courier, monospace; margin-bottom: 1em; margin-top: 1em; overflow-x: auto; overflow-y: auto; padding-bottom: 5px; padding-left: 5px; padding-right: 5px; padding-top: 5px;&quot;&gt;&lt;code style=&quot;background-color: rgb(238, 238, 238) !important; border-bottom-color: rgb(222, 222, 222) !important; border-bottom-style: none !important; border-bottom-width: 1px !important; border-color: initial !important; border-left-color: rgb(222, 222, 222) !important; border-left-style: none !important; border-left-width: 1px !important; border-right-color: rgb(222, 222, 222) !important; border-right-style: none !important; border-right-width: 1px !important; border-top-color: rgb(222, 222, 222) !important; border-top-style: none !important; border-top-width: 1px !important; border-width: initial !important; color: rgb(68, 68, 68) !important; font-size: 12px !important; font: normal normal normal 12px/normal &#39;Bitstream Vera Sans Mono&#39;, Courier, monospace; margin-bottom: 0px; margin-left: 0px; margin-right: 0px; margin-top: 0px; padding-bottom: 0px !important; padding-left: 0px !important; padding-right: 0px !important; padding-top: 0px !important;&quot;&gt;Person.where{name.like_any names}
# =&amp;gt; SELECT &quot;people&quot;.* FROM &quot;people&quot;  
     WHERE ((&quot;people&quot;.&quot;name&quot; LIKE &#39;Ernie%&#39; OR &quot;people&quot;.&quot;name&quot; LIKE &#39;Joe%&#39; OR &quot;people&quot;.&quot;name&quot; LIKE &#39;Mary%&#39;))
&lt;/code&gt;&lt;/pre&gt;
&lt;div style=&quot;line-height: 1.5em !important; margin-bottom: 1em !important; margin-top: 1em !important; padding-bottom: 0px; padding-left: 0px; padding-right: 0px; padding-top: 0px;&quot;&gt;
I&#39;m not sure about you, but I much prefer the latter. In short, you can add&amp;nbsp;&lt;code style=&quot;background-color: rgb(248, 248, 255) !important; border-bottom-color: rgb(222, 222, 222) !important; border-bottom-style: solid !important; border-bottom-width: 1px !important; border-left-color: rgb(222, 222, 222) !important; border-left-style: solid !important; border-left-width: 1px !important; border-right-color: rgb(222, 222, 222) !important; border-right-style: solid !important; border-right-width: 1px !important; border-top-color: rgb(222, 222, 222) !important; border-top-style: solid !important; border-top-width: 1px !important; color: rgb(68, 68, 68) !important; font-size: 12px !important; font: normal normal normal 12px/normal &#39;Bitstream Vera Sans Mono&#39;, Courier, monospace; margin-bottom: 0px; margin-left: 0px; margin-right: 0px; margin-top: 0px; padding-bottom: 0px !important; padding-left: 0.2em !important; padding-right: 0.2em !important; padding-top: 0px !important;&quot;&gt;_any&lt;/code&gt;&amp;nbsp;or&amp;nbsp;&lt;code style=&quot;background-color: rgb(248, 248, 255) !important; border-bottom-color: rgb(222, 222, 222) !important; border-bottom-style: solid !important; border-bottom-width: 1px !important; border-left-color: rgb(222, 222, 222) !important; border-left-style: solid !important; border-left-width: 1px !important; border-right-color: rgb(222, 222, 222) !important; border-right-style: solid !important; border-right-width: 1px !important; border-top-color: rgb(222, 222, 222) !important; border-top-style: solid !important; border-top-width: 1px !important; color: rgb(68, 68, 68) !important; font-size: 12px !important; font: normal normal normal 12px/normal &#39;Bitstream Vera Sans Mono&#39;, Courier, monospace; margin-bottom: 0px; margin-left: 0px; margin-right: 0px; margin-top: 0px; padding-bottom: 0px !important; padding-left: 0.2em !important; padding-right: 0.2em !important; padding-top: 0px !important;&quot;&gt;_all&lt;/code&gt;&amp;nbsp;to any predicate method, and it would do what you expect, when given an array of possibilities to compare against.&lt;/div&gt;
&lt;h3 style=&quot;border-bottom-width: 0px !important; border-color: initial !important; border-left-width: 0px !important; border-right-width: 0px !important; border-style: initial !important; border-top-width: 0px !important; margin-bottom: 1em; margin-left: 0px; margin-right: 0px; margin-top: 1em !important; padding-bottom: 0px; padding-left: 0px; padding-right: 0px; padding-top: 0px;&quot;&gt;

Sifters&lt;/h3&gt;
&lt;div style=&quot;line-height: 1.5em !important; margin-bottom: 1em !important; margin-top: 1em !important; padding-bottom: 0px; padding-left: 0px; padding-right: 0px; padding-top: 0px;&quot;&gt;
Sifters are like little snippets of conditions that take parameters. Let&#39;s say that you have a model called Article, and you often want to query for articles that contain a string in the title or body. So you write a scope:&lt;/div&gt;
&lt;pre style=&quot;-webkit-box-shadow: rgba(0, 0, 0, 0.0664063) 0px 1px 2px inset; background-color: #eeeeee; border-bottom-color: rgb(221, 221, 221); border-bottom-left-radius: 3px 3px; border-bottom-right-radius: 3px 3px; border-bottom-style: solid; border-bottom-width: 1px; border-left-color: rgb(221, 221, 221); border-left-style: solid; border-left-width: 1px; border-right-color: rgb(221, 221, 221); border-right-style: solid; border-right-width: 1px; border-top-color: rgb(221, 221, 221); border-top-left-radius: 3px 3px; border-top-right-radius: 3px 3px; border-top-style: solid; border-top-width: 1px; color: #444444; font-size: 12px; font: normal normal normal 12px/normal &#39;Bitstream Vera Sans Mono&#39;, Courier, monospace; margin-bottom: 1em; margin-top: 1em; overflow-x: auto; overflow-y: auto; padding-bottom: 5px; padding-left: 5px; padding-right: 5px; padding-top: 5px;&quot;&gt;&lt;code style=&quot;background-color: rgb(238, 238, 238) !important; border-bottom-color: rgb(222, 222, 222) !important; border-bottom-style: none !important; border-bottom-width: 1px !important; border-color: initial !important; border-left-color: rgb(222, 222, 222) !important; border-left-style: none !important; border-left-width: 1px !important; border-right-color: rgb(222, 222, 222) !important; border-right-style: none !important; border-right-width: 1px !important; border-top-color: rgb(222, 222, 222) !important; border-top-style: none !important; border-top-width: 1px !important; border-width: initial !important; color: rgb(68, 68, 68) !important; font-size: 12px !important; font: normal normal normal 12px/normal &#39;Bitstream Vera Sans Mono&#39;, Courier, monospace; margin-bottom: 0px; margin-left: 0px; margin-right: 0px; margin-top: 0px; padding-bottom: 0px !important; padding-left: 0px !important; padding-right: 0px !important; padding-top: 0px !important;&quot;&gt;def self.title_or_body_contains(string)
  where{title.matches(&quot;%#{string}%&quot;) | body.matches(&quot;%#{string}%&quot;)}
end
&lt;/code&gt;&lt;/pre&gt;
&lt;div style=&quot;line-height: 1.5em !important; margin-bottom: 1em !important; margin-top: 1em !important; padding-bottom: 0px; padding-left: 0px; padding-right: 0px; padding-top: 0px;&quot;&gt;
But then you want to query for people who wrote an article that matches these conditions, but the scope only works against the model where it was defined. So instead, you write a sifter:&lt;/div&gt;
&lt;pre style=&quot;-webkit-box-shadow: rgba(0, 0, 0, 0.0664063) 0px 1px 2px inset; background-color: #eeeeee; border-bottom-color: rgb(221, 221, 221); border-bottom-left-radius: 3px 3px; border-bottom-right-radius: 3px 3px; border-bottom-style: solid; border-bottom-width: 1px; border-left-color: rgb(221, 221, 221); border-left-style: solid; border-left-width: 1px; border-right-color: rgb(221, 221, 221); border-right-style: solid; border-right-width: 1px; border-top-color: rgb(221, 221, 221); border-top-left-radius: 3px 3px; border-top-right-radius: 3px 3px; border-top-style: solid; border-top-width: 1px; color: #444444; font-size: 12px; font: normal normal normal 12px/normal &#39;Bitstream Vera Sans Mono&#39;, Courier, monospace; margin-bottom: 1em; margin-top: 1em; overflow-x: auto; overflow-y: auto; padding-bottom: 5px; padding-left: 5px; padding-right: 5px; padding-top: 5px;&quot;&gt;&lt;code style=&quot;background-color: rgb(238, 238, 238) !important; border-bottom-color: rgb(222, 222, 222) !important; border-bottom-style: none !important; border-bottom-width: 1px !important; border-color: initial !important; border-left-color: rgb(222, 222, 222) !important; border-left-style: none !important; border-left-width: 1px !important; border-right-color: rgb(222, 222, 222) !important; border-right-style: none !important; border-right-width: 1px !important; border-top-color: rgb(222, 222, 222) !important; border-top-style: none !important; border-top-width: 1px !important; border-width: initial !important; color: rgb(68, 68, 68) !important; font-size: 12px !important; font: normal normal normal 12px/normal &#39;Bitstream Vera Sans Mono&#39;, Courier, monospace; margin-bottom: 0px; margin-left: 0px; margin-right: 0px; margin-top: 0px; padding-bottom: 0px !important; padding-left: 0px !important; padding-right: 0px !important; padding-top: 0px !important;&quot;&gt;class Article &amp;lt; ActiveRecord::Base
  sifter :title_or_body_contains do |string|
    title.matches(&quot;%#{string}%&quot;) | body.matches(&quot;%#{string}%&quot;)
  end
end
&lt;/code&gt;&lt;/pre&gt;
&lt;div style=&quot;line-height: 1.5em !important; margin-bottom: 1em !important; margin-top: 1em !important; padding-bottom: 0px; padding-left: 0px; padding-right: 0px; padding-top: 0px;&quot;&gt;
Now you can write...&lt;/div&gt;
&lt;pre style=&quot;-webkit-box-shadow: rgba(0, 0, 0, 0.0664063) 0px 1px 2px inset; background-color: #eeeeee; border-bottom-color: rgb(221, 221, 221); border-bottom-left-radius: 3px 3px; border-bottom-right-radius: 3px 3px; border-bottom-style: solid; border-bottom-width: 1px; border-left-color: rgb(221, 221, 221); border-left-style: solid; border-left-width: 1px; border-right-color: rgb(221, 221, 221); border-right-style: solid; border-right-width: 1px; border-top-color: rgb(221, 221, 221); border-top-left-radius: 3px 3px; border-top-right-radius: 3px 3px; border-top-style: solid; border-top-width: 1px; color: #444444; font-size: 12px; font: normal normal normal 12px/normal &#39;Bitstream Vera Sans Mono&#39;, Courier, monospace; margin-bottom: 1em; margin-top: 1em; overflow-x: auto; overflow-y: auto; padding-bottom: 5px; padding-left: 5px; padding-right: 5px; padding-top: 5px;&quot;&gt;&lt;code style=&quot;background-color: rgb(238, 238, 238) !important; border-bottom-color: rgb(222, 222, 222) !important; border-bottom-style: none !important; border-bottom-width: 1px !important; border-color: initial !important; border-left-color: rgb(222, 222, 222) !important; border-left-style: none !important; border-left-width: 1px !important; border-right-color: rgb(222, 222, 222) !important; border-right-style: none !important; border-right-width: 1px !important; border-top-color: rgb(222, 222, 222) !important; border-top-style: none !important; border-top-width: 1px !important; border-width: initial !important; color: rgb(68, 68, 68) !important; font-size: 12px !important; font: normal normal normal 12px/normal &#39;Bitstream Vera Sans Mono&#39;, Courier, monospace; margin-bottom: 0px; margin-left: 0px; margin-right: 0px; margin-top: 0px; padding-bottom: 0px !important; padding-left: 0px !important; padding-right: 0px !important; padding-top: 0px !important;&quot;&gt;Article.where{sift :title_or_body_contains, &#39;awesome&#39;}
=&amp;gt; SELECT &quot;articles&quot;.* FROM &quot;articles&quot;  
   WHERE ((
     &quot;articles&quot;.&quot;title&quot; LIKE &#39;%awesome%&#39; 
     OR &quot;articles&quot;.&quot;body&quot; LIKE &#39;%awesome%&#39;
   ))
&lt;/code&gt;&lt;/pre&gt;
&lt;div style=&quot;line-height: 1.5em !important; margin-bottom: 1em !important; margin-top: 1em !important; padding-bottom: 0px; padding-left: 0px; padding-right: 0px; padding-top: 0px;&quot;&gt;
... or ...&lt;/div&gt;
&lt;pre style=&quot;-webkit-box-shadow: rgba(0, 0, 0, 0.0664063) 0px 1px 2px inset; background-color: #eeeeee; border-bottom-color: rgb(221, 221, 221); border-bottom-left-radius: 3px 3px; border-bottom-right-radius: 3px 3px; border-bottom-style: solid; border-bottom-width: 1px; border-left-color: rgb(221, 221, 221); border-left-style: solid; border-left-width: 1px; border-right-color: rgb(221, 221, 221); border-right-style: solid; border-right-width: 1px; border-top-color: rgb(221, 221, 221); border-top-left-radius: 3px 3px; border-top-right-radius: 3px 3px; border-top-style: solid; border-top-width: 1px; color: #444444; font-size: 12px; font: normal normal normal 12px/normal &#39;Bitstream Vera Sans Mono&#39;, Courier, monospace; margin-bottom: 1em; margin-top: 1em; overflow-x: auto; overflow-y: auto; padding-bottom: 5px; padding-left: 5px; padding-right: 5px; padding-top: 5px;&quot;&gt;&lt;code style=&quot;background-color: rgb(238, 238, 238) !important; border-bottom-color: rgb(222, 222, 222) !important; border-bottom-style: none !important; border-bottom-width: 1px !important; border-color: initial !important; border-left-color: rgb(222, 222, 222) !important; border-left-style: none !important; border-left-width: 1px !important; border-right-color: rgb(222, 222, 222) !important; border-right-style: none !important; border-right-width: 1px !important; border-top-color: rgb(222, 222, 222) !important; border-top-style: none !important; border-top-width: 1px !important; border-width: initial !important; color: rgb(68, 68, 68) !important; font-size: 12px !important; font: normal normal normal 12px/normal &#39;Bitstream Vera Sans Mono&#39;, Courier, monospace; margin-bottom: 0px; margin-left: 0px; margin-right: 0px; margin-top: 0px; padding-bottom: 0px !important; padding-left: 0px !important; padding-right: 0px !important; padding-top: 0px !important;&quot;&gt;Person.joins(:articles).
       where{
         {articles =&amp;gt; sift(:title_or_body_contains, &#39;awesome&#39;)}
       }
# =&amp;gt; SELECT &quot;people&quot;.* FROM &quot;people&quot; 
     INNER JOIN &quot;articles&quot; ON &quot;articles&quot;.&quot;person_id&quot; = &quot;people&quot;.&quot;id&quot; 
     WHERE ((
       &quot;articles&quot;.&quot;title&quot; LIKE &#39;%awesome%&#39; 
       OR &quot;articles&quot;.&quot;body&quot; LIKE &#39;%awesome%&#39;
     ))
&lt;/code&gt;&lt;/pre&gt;
&lt;div style=&quot;line-height: 1.5em !important; margin-bottom: 1em !important; margin-top: 1em !important; padding-bottom: 0px; padding-left: 0px; padding-right: 0px; padding-top: 0px;&quot;&gt;
Or, you can just modify your previous scope, changing&amp;nbsp;&lt;code style=&quot;background-color: rgb(248, 248, 255) !important; border-bottom-color: rgb(222, 222, 222) !important; border-bottom-style: solid !important; border-bottom-width: 1px !important; border-left-color: rgb(222, 222, 222) !important; border-left-style: solid !important; border-left-width: 1px !important; border-right-color: rgb(222, 222, 222) !important; border-right-style: solid !important; border-right-width: 1px !important; border-top-color: rgb(222, 222, 222) !important; border-top-style: solid !important; border-top-width: 1px !important; color: rgb(68, 68, 68) !important; font-size: 12px !important; font: normal normal normal 12px/normal &#39;Bitstream Vera Sans Mono&#39;, Courier, monospace; margin-bottom: 0px; margin-left: 0px; margin-right: 0px; margin-top: 0px; padding-bottom: 0px !important; padding-left: 0.2em !important; padding-right: 0.2em !important; padding-top: 0px !important;&quot;&gt;where&lt;/code&gt;&amp;nbsp;to&amp;nbsp;&lt;code style=&quot;background-color: rgb(248, 248, 255) !important; border-bottom-color: rgb(222, 222, 222) !important; border-bottom-style: solid !important; border-bottom-width: 1px !important; border-left-color: rgb(222, 222, 222) !important; border-left-style: solid !important; border-left-width: 1px !important; border-right-color: rgb(222, 222, 222) !important; border-right-style: solid !important; border-right-width: 1px !important; border-top-color: rgb(222, 222, 222) !important; border-top-style: solid !important; border-top-width: 1px !important; color: rgb(68, 68, 68) !important; font-size: 12px !important; font: normal normal normal 12px/normal &#39;Bitstream Vera Sans Mono&#39;, Courier, monospace; margin-bottom: 0px; margin-left: 0px; margin-right: 0px; margin-top: 0px; padding-bottom: 0px !important; padding-left: 0.2em !important; padding-right: 0.2em !important; padding-top: 0px !important;&quot;&gt;squeel&lt;/code&gt;:&lt;/div&gt;
&lt;pre style=&quot;-webkit-box-shadow: rgba(0, 0, 0, 0.0664063) 0px 1px 2px inset; background-color: #eeeeee; border-bottom-color: rgb(221, 221, 221); border-bottom-left-radius: 3px 3px; border-bottom-right-radius: 3px 3px; border-bottom-style: solid; border-bottom-width: 1px; border-left-color: rgb(221, 221, 221); border-left-style: solid; border-left-width: 1px; border-right-color: rgb(221, 221, 221); border-right-style: solid; border-right-width: 1px; border-top-color: rgb(221, 221, 221); border-top-left-radius: 3px 3px; border-top-right-radius: 3px 3px; border-top-style: solid; border-top-width: 1px; color: #444444; font-size: 12px; font: normal normal normal 12px/normal &#39;Bitstream Vera Sans Mono&#39;, Courier, monospace; margin-bottom: 1em; margin-top: 1em; overflow-x: auto; overflow-y: auto; padding-bottom: 5px; padding-left: 5px; padding-right: 5px; padding-top: 5px;&quot;&gt;&lt;code style=&quot;background-color: rgb(238, 238, 238) !important; border-bottom-color: rgb(222, 222, 222) !important; border-bottom-style: none !important; border-bottom-width: 1px !important; border-color: initial !important; border-left-color: rgb(222, 222, 222) !important; border-left-style: none !important; border-left-width: 1px !important; border-right-color: rgb(222, 222, 222) !important; border-right-style: none !important; border-right-width: 1px !important; border-top-color: rgb(222, 222, 222) !important; border-top-style: none !important; border-top-width: 1px !important; border-width: initial !important; color: rgb(68, 68, 68) !important; font-size: 12px !important; font: normal normal normal 12px/normal &#39;Bitstream Vera Sans Mono&#39;, Courier, monospace; margin-bottom: 0px; margin-left: 0px; margin-right: 0px; margin-top: 0px; padding-bottom: 0px !important; padding-left: 0px !important; padding-right: 0px !important; padding-top: 0px !important;&quot;&gt;def self.title_or_body_contains(string)
  squeel{title.matches(&quot;%#{string}%&quot;) | body.matches(&quot;%#{string}%&quot;)}
end
&lt;/code&gt;&lt;/pre&gt;
&lt;h3 style=&quot;border-bottom-width: 0px !important; border-color: initial !important; border-left-width: 0px !important; border-right-width: 0px !important; border-style: initial !important; border-top-width: 0px !important; margin-bottom: 1em; margin-left: 0px; margin-right: 0px; margin-top: 1em !important; padding-bottom: 0px; padding-left: 0px; padding-right: 0px; padding-top: 0px;&quot;&gt;

Subqueries&lt;/h3&gt;
&lt;div style=&quot;line-height: 1.5em !important; margin-bottom: 1em !important; margin-top: 1em !important; padding-bottom: 0px; padding-left: 0px; padding-right: 0px; padding-top: 0px;&quot;&gt;
You can supply an&amp;nbsp;&lt;code style=&quot;background-color: rgb(248, 248, 255) !important; border-bottom-color: rgb(222, 222, 222) !important; border-bottom-style: solid !important; border-bottom-width: 1px !important; border-left-color: rgb(222, 222, 222) !important; border-left-style: solid !important; border-left-width: 1px !important; border-right-color: rgb(222, 222, 222) !important; border-right-style: solid !important; border-right-width: 1px !important; border-top-color: rgb(222, 222, 222) !important; border-top-style: solid !important; border-top-width: 1px !important; color: rgb(68, 68, 68) !important; font-size: 12px !important; font: normal normal normal 12px/normal &#39;Bitstream Vera Sans Mono&#39;, Courier, monospace; margin-bottom: 0px; margin-left: 0px; margin-right: 0px; margin-top: 0px; padding-bottom: 0px !important; padding-left: 0.2em !important; padding-right: 0.2em !important; padding-top: 0px !important;&quot;&gt;ActiveRecord::Relation&lt;/code&gt;&amp;nbsp;as a value for a predicate in order to use a subquery. So, for example:&lt;/div&gt;
&lt;pre style=&quot;-webkit-box-shadow: rgba(0, 0, 0, 0.0664063) 0px 1px 2px inset; background-color: #eeeeee; border-bottom-color: rgb(221, 221, 221); border-bottom-left-radius: 3px 3px; border-bottom-right-radius: 3px 3px; border-bottom-style: solid; border-bottom-width: 1px; border-left-color: rgb(221, 221, 221); border-left-style: solid; border-left-width: 1px; border-right-color: rgb(221, 221, 221); border-right-style: solid; border-right-width: 1px; border-top-color: rgb(221, 221, 221); border-top-left-radius: 3px 3px; border-top-right-radius: 3px 3px; border-top-style: solid; border-top-width: 1px; color: #444444; font-size: 12px; font: normal normal normal 12px/normal &#39;Bitstream Vera Sans Mono&#39;, Courier, monospace; margin-bottom: 1em; margin-top: 1em; overflow-x: auto; overflow-y: auto; padding-bottom: 5px; padding-left: 5px; padding-right: 5px; padding-top: 5px;&quot;&gt;&lt;code style=&quot;background-color: rgb(238, 238, 238) !important; border-bottom-color: rgb(222, 222, 222) !important; border-bottom-style: none !important; border-bottom-width: 1px !important; border-color: initial !important; border-left-color: rgb(222, 222, 222) !important; border-left-style: none !important; border-left-width: 1px !important; border-right-color: rgb(222, 222, 222) !important; border-right-style: none !important; border-right-width: 1px !important; border-top-color: rgb(222, 222, 222) !important; border-top-style: none !important; border-top-width: 1px !important; border-width: initial !important; color: rgb(68, 68, 68) !important; font-size: 12px !important; font: normal normal normal 12px/normal &#39;Bitstream Vera Sans Mono&#39;, Courier, monospace; margin-bottom: 0px; margin-left: 0px; margin-right: 0px; margin-top: 0px; padding-bottom: 0px !important; padding-left: 0px !important; padding-right: 0px !important; padding-top: 0px !important;&quot;&gt;awesome_people = Person.where{awesome == true}
Article.where{author_id.in(awesome_people.select{id})}
# =&amp;gt; SELECT &quot;articles&quot;.* FROM &quot;articles&quot;  
     WHERE &quot;articles&quot;.&quot;author_id&quot; IN (SELECT &quot;people&quot;.&quot;id&quot; FROM &quot;people&quot;  WHERE &quot;people&quot;.&quot;awesome&quot; = &#39;t&#39;)
&lt;/code&gt;&lt;/pre&gt;
&lt;h3 style=&quot;border-bottom-width: 0px !important; border-color: initial !important; border-left-width: 0px !important; border-right-width: 0px !important; border-style: initial !important; border-top-width: 0px !important; margin-bottom: 1em; margin-left: 0px; margin-right: 0px; margin-top: 1em !important; padding-bottom: 0px; padding-left: 0px; padding-right: 0px; padding-top: 0px;&quot;&gt;

Joins&lt;/h3&gt;
&lt;div style=&quot;line-height: 1.5em !important; margin-bottom: 1em !important; margin-top: 1em !important; padding-bottom: 0px; padding-left: 0px; padding-right: 0px; padding-top: 0px;&quot;&gt;
Squeel adds a couple of enhancements to joins. First, keypaths can be used as shorthand for nested association joins. Second, you can specify join types (inner and outer), and a class in the case of a polymorphic belongs_to relationship.&lt;/div&gt;
&lt;pre style=&quot;-webkit-box-shadow: rgba(0, 0, 0, 0.0664063) 0px 1px 2px inset; background-color: #eeeeee; border-bottom-color: rgb(221, 221, 221); border-bottom-left-radius: 3px 3px; border-bottom-right-radius: 3px 3px; border-bottom-style: solid; border-bottom-width: 1px; border-left-color: rgb(221, 221, 221); border-left-style: solid; border-left-width: 1px; border-right-color: rgb(221, 221, 221); border-right-style: solid; border-right-width: 1px; border-top-color: rgb(221, 221, 221); border-top-left-radius: 3px 3px; border-top-right-radius: 3px 3px; border-top-style: solid; border-top-width: 1px; color: #444444; font-size: 12px; font: normal normal normal 12px/normal &#39;Bitstream Vera Sans Mono&#39;, Courier, monospace; margin-bottom: 1em; margin-top: 1em; overflow-x: auto; overflow-y: auto; padding-bottom: 5px; padding-left: 5px; padding-right: 5px; padding-top: 5px;&quot;&gt;&lt;code style=&quot;background-color: rgb(238, 238, 238) !important; border-bottom-color: rgb(222, 222, 222) !important; border-bottom-style: none !important; border-bottom-width: 1px !important; border-color: initial !important; border-left-color: rgb(222, 222, 222) !important; border-left-style: none !important; border-left-width: 1px !important; border-right-color: rgb(222, 222, 222) !important; border-right-style: none !important; border-right-width: 1px !important; border-top-color: rgb(222, 222, 222) !important; border-top-style: none !important; border-top-width: 1px !important; border-width: initial !important; color: rgb(68, 68, 68) !important; font-size: 12px !important; font: normal normal normal 12px/normal &#39;Bitstream Vera Sans Mono&#39;, Courier, monospace; margin-bottom: 0px; margin-left: 0px; margin-right: 0px; margin-top: 0px; padding-bottom: 0px !important; padding-left: 0px !important; padding-right: 0px !important; padding-top: 0px !important;&quot;&gt;Person.joins{articles.outer}
=&amp;gt; SELECT &quot;people&quot;.* FROM &quot;people&quot;
   LEFT OUTER JOIN &quot;articles&quot; ON &quot;articles&quot;.&quot;person_id&quot; = &quot;people&quot;.&quot;id&quot;
Note.joins{notable(Person).outer}
=&amp;gt; SELECT &quot;notes&quot;.* FROM &quot;notes&quot;
   LEFT OUTER JOIN &quot;people&quot;
     ON &quot;people&quot;.&quot;id&quot; = &quot;notes&quot;.&quot;notable_id&quot;
     AND &quot;notes&quot;.&quot;notable_type&quot; = &#39;Person&#39;
&lt;/code&gt;&lt;/pre&gt;
&lt;div style=&quot;line-height: 1.5em !important; margin-bottom: 1em !important; margin-top: 1em !important; padding-bottom: 0px; padding-left: 0px; padding-right: 0px; padding-top: 0px;&quot;&gt;
These can also be used inside keypaths:&lt;/div&gt;
&lt;pre style=&quot;-webkit-box-shadow: rgba(0, 0, 0, 0.0664063) 0px 1px 2px inset; background-color: #eeeeee; border-bottom-color: rgb(221, 221, 221); border-bottom-left-radius: 3px 3px; border-bottom-right-radius: 3px 3px; border-bottom-style: solid; border-bottom-width: 1px; border-left-color: rgb(221, 221, 221); border-left-style: solid; border-left-width: 1px; border-right-color: rgb(221, 221, 221); border-right-style: solid; border-right-width: 1px; border-top-color: rgb(221, 221, 221); border-top-left-radius: 3px 3px; border-top-right-radius: 3px 3px; border-top-style: solid; border-top-width: 1px; color: #444444; font-size: 12px; font: normal normal normal 12px/normal &#39;Bitstream Vera Sans Mono&#39;, Courier, monospace; margin-bottom: 1em; margin-top: 1em; overflow-x: auto; overflow-y: auto; padding-bottom: 5px; padding-left: 5px; padding-right: 5px; padding-top: 5px;&quot;&gt;&lt;code style=&quot;background-color: rgb(238, 238, 238) !important; border-bottom-color: rgb(222, 222, 222) !important; border-bottom-style: none !important; border-bottom-width: 1px !important; border-color: initial !important; border-left-color: rgb(222, 222, 222) !important; border-left-style: none !important; border-left-width: 1px !important; border-right-color: rgb(222, 222, 222) !important; border-right-style: none !important; border-right-width: 1px !important; border-top-color: rgb(222, 222, 222) !important; border-top-style: none !important; border-top-width: 1px !important; border-width: initial !important; color: rgb(68, 68, 68) !important; font-size: 12px !important; font: normal normal normal 12px/normal &#39;Bitstream Vera Sans Mono&#39;, Courier, monospace; margin-bottom: 0px; margin-left: 0px; margin-right: 0px; margin-top: 0px; padding-bottom: 0px !important; padding-left: 0px !important; padding-right: 0px !important; padding-top: 0px !important;&quot;&gt;Note.joins{notable(Person).articles}
=&amp;gt; SELECT &quot;notes&quot;.* FROM &quot;notes&quot;
   INNER JOIN &quot;people&quot; ON &quot;people&quot;.&quot;id&quot; = &quot;notes&quot;.&quot;notable_id&quot;
     AND &quot;notes&quot;.&quot;notable_type&quot; = &#39;Person&#39;
   INNER JOIN &quot;articles&quot; ON &quot;articles&quot;.&quot;person_id&quot; = &quot;people&quot;.&quot;id&quot;
&lt;/code&gt;&lt;/pre&gt;
&lt;div style=&quot;line-height: 1.5em !important; margin-bottom: 1em !important; margin-top: 1em !important; padding-bottom: 0px; padding-left: 0px; padding-right: 0px; padding-top: 0px;&quot;&gt;
You can refer to these associations when constructing other parts of your query, and they&#39;ll be automatically mapped to the proper table or table alias This is most noticeable when using self-referential associations:&lt;/div&gt;
&lt;pre style=&quot;-webkit-box-shadow: rgba(0, 0, 0, 0.0664063) 0px 1px 2px inset; background-color: #eeeeee; border-bottom-color: rgb(221, 221, 221); border-bottom-left-radius: 3px 3px; border-bottom-right-radius: 3px 3px; border-bottom-style: solid; border-bottom-width: 1px; border-left-color: rgb(221, 221, 221); border-left-style: solid; border-left-width: 1px; border-right-color: rgb(221, 221, 221); border-right-style: solid; border-right-width: 1px; border-top-color: rgb(221, 221, 221); border-top-left-radius: 3px 3px; border-top-right-radius: 3px 3px; border-top-style: solid; border-top-width: 1px; color: #444444; font-size: 12px; font: normal normal normal 12px/normal &#39;Bitstream Vera Sans Mono&#39;, Courier, monospace; margin-bottom: 1em; margin-top: 1em; overflow-x: auto; overflow-y: auto; padding-bottom: 5px; padding-left: 5px; padding-right: 5px; padding-top: 5px;&quot;&gt;&lt;code style=&quot;background-color: rgb(238, 238, 238) !important; border-bottom-color: rgb(222, 222, 222) !important; border-bottom-style: none !important; border-bottom-width: 1px !important; border-color: initial !important; border-left-color: rgb(222, 222, 222) !important; border-left-style: none !important; border-left-width: 1px !important; border-right-color: rgb(222, 222, 222) !important; border-right-style: none !important; border-right-width: 1px !important; border-top-color: rgb(222, 222, 222) !important; border-top-style: none !important; border-top-width: 1px !important; border-width: initial !important; color: rgb(68, 68, 68) !important; font-size: 12px !important; font: normal normal normal 12px/normal &#39;Bitstream Vera Sans Mono&#39;, Courier, monospace; margin-bottom: 0px; margin-left: 0px; margin-right: 0px; margin-top: 0px; padding-bottom: 0px !important; padding-left: 0px !important; padding-right: 0px !important; padding-top: 0px !important;&quot;&gt;Person.joins{children.parent.children}.
       where{
         (children.name.like &#39;Ernie%&#39;) |
         (children.parent.name.like &#39;Ernie%&#39;) |
         (children.parent.children.name.like &#39;Ernie%&#39;)
       }
=&amp;gt; SELECT &quot;people&quot;.* FROM &quot;people&quot; 
   INNER JOIN &quot;people&quot; &quot;children_people&quot; ON &quot;children_people&quot;.&quot;parent_id&quot; = &quot;people&quot;.&quot;id&quot; 
   INNER JOIN &quot;people&quot; &quot;parents_people&quot; ON &quot;parents_people&quot;.&quot;id&quot; = &quot;children_people&quot;.&quot;parent_id&quot; 
   INNER JOIN &quot;people&quot; &quot;children_people_2&quot; ON &quot;children_people_2&quot;.&quot;parent_id&quot; = &quot;parents_people&quot;.&quot;id&quot; 
   WHERE (((&quot;children_people&quot;.&quot;name&quot; LIKE &#39;Ernie%&#39; 
         OR &quot;parents_people&quot;.&quot;name&quot; LIKE &#39;Ernie%&#39;) 
         OR &quot;children_people_2&quot;.&quot;name&quot; LIKE &#39;Ernie%&#39;))
&lt;/code&gt;&lt;/pre&gt;
&lt;div style=&quot;line-height: 1.5em !important; margin-bottom: 1em !important; margin-top: 1em !important; padding-bottom: 0px; padding-left: 0px; padding-right: 0px; padding-top: 0px;&quot;&gt;
Keypaths were used here for clarity, but nested hashes would work just as well.&lt;/div&gt;
&lt;h3 style=&quot;border-bottom-width: 0px !important; border-color: initial !important; border-left-width: 0px !important; border-right-width: 0px !important; border-style: initial !important; border-top-width: 0px !important; margin-bottom: 1em; margin-left: 0px; margin-right: 0px; margin-top: 1em !important; padding-bottom: 0px; padding-left: 0px; padding-right: 0px; padding-top: 0px;&quot;&gt;

Functions&lt;/h3&gt;
&lt;div style=&quot;line-height: 1.5em !important; margin-bottom: 1em !important; margin-top: 1em !important; padding-bottom: 0px; padding-left: 0px; padding-right: 0px; padding-top: 0px;&quot;&gt;
You can call SQL functions just like you would call a method in Ruby...&lt;/div&gt;
&lt;pre style=&quot;-webkit-box-shadow: rgba(0, 0, 0, 0.0664063) 0px 1px 2px inset; background-color: #eeeeee; border-bottom-color: rgb(221, 221, 221); border-bottom-left-radius: 3px 3px; border-bottom-right-radius: 3px 3px; border-bottom-style: solid; border-bottom-width: 1px; border-left-color: rgb(221, 221, 221); border-left-style: solid; border-left-width: 1px; border-right-color: rgb(221, 221, 221); border-right-style: solid; border-right-width: 1px; border-top-color: rgb(221, 221, 221); border-top-left-radius: 3px 3px; border-top-right-radius: 3px 3px; border-top-style: solid; border-top-width: 1px; color: #444444; font-size: 12px; font: normal normal normal 12px/normal &#39;Bitstream Vera Sans Mono&#39;, Courier, monospace; margin-bottom: 1em; margin-top: 1em; overflow-x: auto; overflow-y: auto; padding-bottom: 5px; padding-left: 5px; padding-right: 5px; padding-top: 5px;&quot;&gt;&lt;code style=&quot;background-color: rgb(238, 238, 238) !important; border-bottom-color: rgb(222, 222, 222) !important; border-bottom-style: none !important; border-bottom-width: 1px !important; border-color: initial !important; border-left-color: rgb(222, 222, 222) !important; border-left-style: none !important; border-left-width: 1px !important; border-right-color: rgb(222, 222, 222) !important; border-right-style: none !important; border-right-width: 1px !important; border-top-color: rgb(222, 222, 222) !important; border-top-style: none !important; border-top-width: 1px !important; border-width: initial !important; color: rgb(68, 68, 68) !important; font-size: 12px !important; font: normal normal normal 12px/normal &#39;Bitstream Vera Sans Mono&#39;, Courier, monospace; margin-bottom: 0px; margin-left: 0px; margin-right: 0px; margin-top: 0px; padding-bottom: 0px !important; padding-left: 0px !important; padding-right: 0px !important; padding-top: 0px !important;&quot;&gt;Person.select{coalesce(name, &#39;&amp;lt;no name given&amp;gt;&#39;)}
=&amp;gt; SELECT coalesce(&quot;people&quot;.&quot;name&quot;, &#39;&amp;lt;no name given&amp;gt;&#39;) FROM &quot;people&quot;
&lt;/code&gt;&lt;/pre&gt;
&lt;div style=&quot;line-height: 1.5em !important; margin-bottom: 1em !important; margin-top: 1em !important; padding-bottom: 0px; padding-left: 0px; padding-right: 0px; padding-top: 0px;&quot;&gt;
...and you can easily give it an alias:&lt;/div&gt;
&lt;pre style=&quot;-webkit-box-shadow: rgba(0, 0, 0, 0.0664063) 0px 1px 2px inset; background-color: #eeeeee; border-bottom-color: rgb(221, 221, 221); border-bottom-left-radius: 3px 3px; border-bottom-right-radius: 3px 3px; border-bottom-style: solid; border-bottom-width: 1px; border-left-color: rgb(221, 221, 221); border-left-style: solid; border-left-width: 1px; border-right-color: rgb(221, 221, 221); border-right-style: solid; border-right-width: 1px; border-top-color: rgb(221, 221, 221); border-top-left-radius: 3px 3px; border-top-right-radius: 3px 3px; border-top-style: solid; border-top-width: 1px; color: #444444; font-size: 12px; font: normal normal normal 12px/normal &#39;Bitstream Vera Sans Mono&#39;, Courier, monospace; margin-bottom: 1em; margin-top: 1em; overflow-x: auto; overflow-y: auto; padding-bottom: 5px; padding-left: 5px; padding-right: 5px; padding-top: 5px;&quot;&gt;&lt;code style=&quot;background-color: rgb(238, 238, 238) !important; border-bottom-color: rgb(222, 222, 222) !important; border-bottom-style: none !important; border-bottom-width: 1px !important; border-color: initial !important; border-left-color: rgb(222, 222, 222) !important; border-left-style: none !important; border-left-width: 1px !important; border-right-color: rgb(222, 222, 222) !important; border-right-style: none !important; border-right-width: 1px !important; border-top-color: rgb(222, 222, 222) !important; border-top-style: none !important; border-top-width: 1px !important; border-width: initial !important; color: rgb(68, 68, 68) !important; font-size: 12px !important; font: normal normal normal 12px/normal &#39;Bitstream Vera Sans Mono&#39;, Courier, monospace; margin-bottom: 0px; margin-left: 0px; margin-right: 0px; margin-top: 0px; padding-bottom: 0px !important; padding-left: 0px !important; padding-right: 0px !important; padding-top: 0px !important;&quot;&gt;person = Person.select{
  coalesce(name, &#39;&amp;lt;no name given&amp;gt;&#39;).as(name_with_default)
}.first
person.name_with_default # name or &amp;lt;no name given&amp;gt;, depending on data
&lt;/code&gt;&lt;/pre&gt;
&lt;div style=&quot;line-height: 1.5em !important; margin-bottom: 1em !important; margin-top: 1em !important; padding-bottom: 0px; padding-left: 0px; padding-right: 0px; padding-top: 0px;&quot;&gt;
When you use a stub, symbol, or keypath inside a function call, it&#39;ll be interpreted relative to its place inside any nested associations:&lt;/div&gt;
&lt;pre style=&quot;-webkit-box-shadow: rgba(0, 0, 0, 0.0664063) 0px 1px 2px inset; background-color: #eeeeee; border-bottom-color: rgb(221, 221, 221); border-bottom-left-radius: 3px 3px; border-bottom-right-radius: 3px 3px; border-bottom-style: solid; border-bottom-width: 1px; border-left-color: rgb(221, 221, 221); border-left-style: solid; border-left-width: 1px; border-right-color: rgb(221, 221, 221); border-right-style: solid; border-right-width: 1px; border-top-color: rgb(221, 221, 221); border-top-left-radius: 3px 3px; border-top-right-radius: 3px 3px; border-top-style: solid; border-top-width: 1px; color: #444444; font-size: 12px; font: normal normal normal 12px/normal &#39;Bitstream Vera Sans Mono&#39;, Courier, monospace; margin-bottom: 1em; margin-top: 1em; overflow-x: auto; overflow-y: auto; padding-bottom: 5px; padding-left: 5px; padding-right: 5px; padding-top: 5px;&quot;&gt;&lt;code style=&quot;background-color: rgb(238, 238, 238) !important; border-bottom-color: rgb(222, 222, 222) !important; border-bottom-style: none !important; border-bottom-width: 1px !important; border-color: initial !important; border-left-color: rgb(222, 222, 222) !important; border-left-style: none !important; border-left-width: 1px !important; border-right-color: rgb(222, 222, 222) !important; border-right-style: none !important; border-right-width: 1px !important; border-top-color: rgb(222, 222, 222) !important; border-top-style: none !important; border-top-width: 1px !important; border-width: initial !important; color: rgb(68, 68, 68) !important; font-size: 12px !important; font: normal normal normal 12px/normal &#39;Bitstream Vera Sans Mono&#39;, Courier, monospace; margin-bottom: 0px; margin-left: 0px; margin-right: 0px; margin-top: 0px; padding-bottom: 0px !important; padding-left: 0px !important; padding-right: 0px !important; padding-top: 0px !important;&quot;&gt;Person.joins{articles}.group{articles.title}.having{{articles =&amp;gt; {max(id) =&amp;gt; id}}}
=&amp;gt; SELECT &quot;people&quot;.* FROM &quot;people&quot; 
   INNER JOIN &quot;articles&quot; ON &quot;articles&quot;.&quot;person_id&quot; = &quot;people&quot;.&quot;id&quot; 
   GROUP BY &quot;articles&quot;.&quot;title&quot; 
   HAVING max(&quot;articles&quot;.&quot;id&quot;) = &quot;articles&quot;.&quot;id&quot;
&lt;/code&gt;&lt;/pre&gt;
&lt;div style=&quot;line-height: 1.5em !important; margin-bottom: 1em !important; margin-top: 1em !important; padding-bottom: 0px; padding-left: 0px; padding-right: 0px; padding-top: 0px;&quot;&gt;
If you want to use an attribute from a different branch of the hierarchy, use an absolute keypath (~) as done here:&lt;/div&gt;
&lt;pre style=&quot;-webkit-box-shadow: rgba(0, 0, 0, 0.0664063) 0px 1px 2px inset; background-color: #eeeeee; border-bottom-color: rgb(221, 221, 221); border-bottom-left-radius: 3px 3px; border-bottom-right-radius: 3px 3px; border-bottom-style: solid; border-bottom-width: 1px; border-left-color: rgb(221, 221, 221); border-left-style: solid; border-left-width: 1px; border-right-color: rgb(221, 221, 221); border-right-style: solid; border-right-width: 1px; border-top-color: rgb(221, 221, 221); border-top-left-radius: 3px 3px; border-top-right-radius: 3px 3px; border-top-style: solid; border-top-width: 1px; color: #444444; font-size: 12px; font: normal normal normal 12px/normal &#39;Bitstream Vera Sans Mono&#39;, Courier, monospace; margin-bottom: 1em; margin-top: 1em; overflow-x: auto; overflow-y: auto; padding-bottom: 5px; padding-left: 5px; padding-right: 5px; padding-top: 5px;&quot;&gt;&lt;code style=&quot;background-color: rgb(238, 238, 238) !important; border-bottom-color: rgb(222, 222, 222) !important; border-bottom-style: none !important; border-bottom-width: 1px !important; border-color: initial !important; border-left-color: rgb(222, 222, 222) !important; border-left-style: none !important; border-left-width: 1px !important; border-right-color: rgb(222, 222, 222) !important; border-right-style: none !important; border-right-width: 1px !important; border-top-color: rgb(222, 222, 222) !important; border-top-style: none !important; border-top-width: 1px !important; border-width: initial !important; color: rgb(68, 68, 68) !important; font-size: 12px !important; font: normal normal normal 12px/normal &#39;Bitstream Vera Sans Mono&#39;, Courier, monospace; margin-bottom: 0px; margin-left: 0px; margin-right: 0px; margin-top: 0px; padding-bottom: 0px !important; padding-left: 0px !important; padding-right: 0px !important; padding-top: 0px !important;&quot;&gt;Person.joins{articles}.group{articles.title}.having{{articles =&amp;gt; {max(~id) =&amp;gt; id}}}
=&amp;gt; SELECT &quot;people&quot;.* FROM &quot;people&quot; 
   INNER JOIN &quot;articles&quot; ON &quot;articles&quot;.&quot;person_id&quot; = &quot;people&quot;.&quot;id&quot; 
   GROUP BY &quot;articles&quot;.&quot;title&quot; 
   HAVING max(&quot;people&quot;.&quot;id&quot;) = &quot;articles&quot;.&quot;id&quot;
&lt;/code&gt;&lt;/pre&gt;
&lt;h3 style=&quot;border-bottom-width: 0px !important; border-color: initial !important; border-left-width: 0px !important; border-right-width: 0px !important; border-style: initial !important; border-top-width: 0px !important; margin-bottom: 1em; margin-left: 0px; margin-right: 0px; margin-top: 1em !important; padding-bottom: 0px; padding-left: 0px; padding-right: 0px; padding-top: 0px;&quot;&gt;

SQL Operators&lt;/h3&gt;
&lt;div style=&quot;line-height: 1.5em !important; margin-bottom: 1em !important; margin-top: 1em !important; padding-bottom: 0px; padding-left: 0px; padding-right: 0px; padding-top: 0px;&quot;&gt;
You can use the standard mathematical operators (&lt;code style=&quot;background-color: rgb(248, 248, 255) !important; border-bottom-color: rgb(222, 222, 222) !important; border-bottom-style: solid !important; border-bottom-width: 1px !important; border-left-color: rgb(222, 222, 222) !important; border-left-style: solid !important; border-left-width: 1px !important; border-right-color: rgb(222, 222, 222) !important; border-right-style: solid !important; border-right-width: 1px !important; border-top-color: rgb(222, 222, 222) !important; border-top-style: solid !important; border-top-width: 1px !important; color: rgb(68, 68, 68) !important; font-size: 12px !important; font: normal normal normal 12px/normal &#39;Bitstream Vera Sans Mono&#39;, Courier, monospace; margin-bottom: 0px; margin-left: 0px; margin-right: 0px; margin-top: 0px; padding-bottom: 0px !important; padding-left: 0.2em !important; padding-right: 0.2em !important; padding-top: 0px !important;&quot;&gt;+&lt;/code&gt;,&amp;nbsp;&lt;code style=&quot;background-color: rgb(248, 248, 255) !important; border-bottom-color: rgb(222, 222, 222) !important; border-bottom-style: solid !important; border-bottom-width: 1px !important; border-left-color: rgb(222, 222, 222) !important; border-left-style: solid !important; border-left-width: 1px !important; border-right-color: rgb(222, 222, 222) !important; border-right-style: solid !important; border-right-width: 1px !important; border-top-color: rgb(222, 222, 222) !important; border-top-style: solid !important; border-top-width: 1px !important; color: rgb(68, 68, 68) !important; font-size: 12px !important; font: normal normal normal 12px/normal &#39;Bitstream Vera Sans Mono&#39;, Courier, monospace; margin-bottom: 0px; margin-left: 0px; margin-right: 0px; margin-top: 0px; padding-bottom: 0px !important; padding-left: 0.2em !important; padding-right: 0.2em !important; padding-top: 0px !important;&quot;&gt;-&lt;/code&gt;,&amp;nbsp;&lt;code style=&quot;background-color: rgb(248, 248, 255) !important; border-bottom-color: rgb(222, 222, 222) !important; border-bottom-style: solid !important; border-bottom-width: 1px !important; border-left-color: rgb(222, 222, 222) !important; border-left-style: solid !important; border-left-width: 1px !important; border-right-color: rgb(222, 222, 222) !important; border-right-style: solid !important; border-right-width: 1px !important; border-top-color: rgb(222, 222, 222) !important; border-top-style: solid !important; border-top-width: 1px !important; color: rgb(68, 68, 68) !important; font-size: 12px !important; font: normal normal normal 12px/normal &#39;Bitstream Vera Sans Mono&#39;, Courier, monospace; margin-bottom: 0px; margin-left: 0px; margin-right: 0px; margin-top: 0px; padding-bottom: 0px !important; padding-left: 0.2em !important; padding-right: 0.2em !important; padding-top: 0px !important;&quot;&gt;*&lt;/code&gt;,&amp;nbsp;&lt;code style=&quot;background-color: rgb(248, 248, 255) !important; border-bottom-color: rgb(222, 222, 222) !important; border-bottom-style: solid !important; border-bottom-width: 1px !important; border-left-color: rgb(222, 222, 222) !important; border-left-style: solid !important; border-left-width: 1px !important; border-right-color: rgb(222, 222, 222) !important; border-right-style: solid !important; border-right-width: 1px !important; border-top-color: rgb(222, 222, 222) !important; border-top-style: solid !important; border-top-width: 1px !important; color: rgb(68, 68, 68) !important; font-size: 12px !important; font: normal normal normal 12px/normal &#39;Bitstream Vera Sans Mono&#39;, Courier, monospace; margin-bottom: 0px; margin-left: 0px; margin-right: 0px; margin-top: 0px; padding-bottom: 0px !important; padding-left: 0.2em !important; padding-right: 0.2em !important; padding-top: 0px !important;&quot;&gt;/&lt;/code&gt;) inside the Squeel DSL to specify operators in the resulting SQL, or the&amp;nbsp;&lt;code style=&quot;background-color: rgb(248, 248, 255) !important; border-bottom-color: rgb(222, 222, 222) !important; border-bottom-style: solid !important; border-bottom-width: 1px !important; border-left-color: rgb(222, 222, 222) !important; border-left-style: solid !important; border-left-width: 1px !important; border-right-color: rgb(222, 222, 222) !important; border-right-style: solid !important; border-right-width: 1px !important; border-top-color: rgb(222, 222, 222) !important; border-top-style: solid !important; border-top-width: 1px !important; color: rgb(68, 68, 68) !important; font-size: 12px !important; font: normal normal normal 12px/normal &#39;Bitstream Vera Sans Mono&#39;, Courier, monospace; margin-bottom: 0px; margin-left: 0px; margin-right: 0px; margin-top: 0px; padding-bottom: 0px !important; padding-left: 0.2em !important; padding-right: 0.2em !important; padding-top: 0px !important;&quot;&gt;op&lt;/code&gt;&amp;nbsp;method to specify another custom operator, such as the standard SQL concatenation operator,&amp;nbsp;&lt;code style=&quot;background-color: rgb(248, 248, 255) !important; border-bottom-color: rgb(222, 222, 222) !important; border-bottom-style: solid !important; border-bottom-width: 1px !important; border-left-color: rgb(222, 222, 222) !important; border-left-style: solid !important; border-left-width: 1px !important; border-right-color: rgb(222, 222, 222) !important; border-right-style: solid !important; border-right-width: 1px !important; border-top-color: rgb(222, 222, 222) !important; border-top-style: solid !important; border-top-width: 1px !important; color: rgb(68, 68, 68) !important; font-size: 12px !important; font: normal normal normal 12px/normal &#39;Bitstream Vera Sans Mono&#39;, Courier, monospace; margin-bottom: 0px; margin-left: 0px; margin-right: 0px; margin-top: 0px; padding-bottom: 0px !important; padding-left: 0.2em !important; padding-right: 0.2em !important; padding-top: 0px !important;&quot;&gt;||&lt;/code&gt;:&lt;/div&gt;
&lt;pre style=&quot;-webkit-box-shadow: rgba(0, 0, 0, 0.0664063) 0px 1px 2px inset; background-color: #eeeeee; border-bottom-color: rgb(221, 221, 221); border-bottom-left-radius: 3px 3px; border-bottom-right-radius: 3px 3px; border-bottom-style: solid; border-bottom-width: 1px; border-left-color: rgb(221, 221, 221); border-left-style: solid; border-left-width: 1px; border-right-color: rgb(221, 221, 221); border-right-style: solid; border-right-width: 1px; border-top-color: rgb(221, 221, 221); border-top-left-radius: 3px 3px; border-top-right-radius: 3px 3px; border-top-style: solid; border-top-width: 1px; color: #444444; font-size: 12px; font: normal normal normal 12px/normal &#39;Bitstream Vera Sans Mono&#39;, Courier, monospace; margin-bottom: 1em; margin-top: 1em; overflow-x: auto; overflow-y: auto; padding-bottom: 5px; padding-left: 5px; padding-right: 5px; padding-top: 5px;&quot;&gt;&lt;code style=&quot;background-color: rgb(238, 238, 238) !important; border-bottom-color: rgb(222, 222, 222) !important; border-bottom-style: none !important; border-bottom-width: 1px !important; border-color: initial !important; border-left-color: rgb(222, 222, 222) !important; border-left-style: none !important; border-left-width: 1px !important; border-right-color: rgb(222, 222, 222) !important; border-right-style: none !important; border-right-width: 1px !important; border-top-color: rgb(222, 222, 222) !important; border-top-style: none !important; border-top-width: 1px !important; border-width: initial !important; color: rgb(68, 68, 68) !important; font-size: 12px !important; font: normal normal normal 12px/normal &#39;Bitstream Vera Sans Mono&#39;, Courier, monospace; margin-bottom: 0px; margin-left: 0px; margin-right: 0px; margin-top: 0px; padding-bottom: 0px !important; padding-left: 0px !important; padding-right: 0px !important; padding-top: 0px !important;&quot;&gt;p = Person.select{name.op(&#39;||&#39;, &#39;-diddly&#39;).as(flanderized_name)}.first
p.flanderized_name
=&amp;gt; &quot;Aric Smith-diddly&quot; 
&lt;/code&gt;&lt;/pre&gt;
&lt;div style=&quot;line-height: 1.5em !important; margin-bottom: 1em !important; margin-top: 1em !important; padding-bottom: 0px; padding-left: 0px; padding-right: 0px; padding-top: 0px;&quot;&gt;
As you can see, just like functions, these operations can be given aliases.&lt;/div&gt;
&lt;h2 style=&quot;border-bottom-width: 0px !important; border-color: initial !important; border-left-width: 0px !important; border-right-width: 0px !important; border-style: initial !important; border-top-color: rgb(224, 224, 224) !important; border-top-style: solid !important; border-top-width: 4px !important; font-size: 20px; margin-bottom: 1em; margin-left: 0px; margin-right: 0px; margin-top: 1.5em !important; padding-bottom: 0px; padding-left: 0px; padding-right: 0px; padding-top: 0.5em !important;&quot;&gt;

Legacy compatibility&lt;/h2&gt;
&lt;div style=&quot;line-height: 1.5em !important; margin-bottom: 1em !important; margin-top: 1em !important; padding-bottom: 0px; padding-left: 0px; padding-right: 0px; padding-top: 0px;&quot;&gt;
While the Squeel DSL is the preferred way to access advanced query functionality, you can still enable methods on symbols to access ARel predications in a similar manner to MetaWhere:&lt;/div&gt;
&lt;pre style=&quot;-webkit-box-shadow: rgba(0, 0, 0, 0.0664063) 0px 1px 2px inset; background-color: #eeeeee; border-bottom-color: rgb(221, 221, 221); border-bottom-left-radius: 3px 3px; border-bottom-right-radius: 3px 3px; border-bottom-style: solid; border-bottom-width: 1px; border-left-color: rgb(221, 221, 221); border-left-style: solid; border-left-width: 1px; border-right-color: rgb(221, 221, 221); border-right-style: solid; border-right-width: 1px; border-top-color: rgb(221, 221, 221); border-top-left-radius: 3px 3px; border-top-right-radius: 3px 3px; border-top-style: solid; border-top-width: 1px; color: #444444; font-size: 12px; font: normal normal normal 12px/normal &#39;Bitstream Vera Sans Mono&#39;, Courier, monospace; margin-bottom: 1em; margin-top: 1em; overflow-x: auto; overflow-y: auto; padding-bottom: 5px; padding-left: 5px; padding-right: 5px; padding-top: 5px;&quot;&gt;&lt;code style=&quot;background-color: rgb(238, 238, 238) !important; border-bottom-color: rgb(222, 222, 222) !important; border-bottom-style: none !important; border-bottom-width: 1px !important; border-color: initial !important; border-left-color: rgb(222, 222, 222) !important; border-left-style: none !important; border-left-width: 1px !important; border-right-color: rgb(222, 222, 222) !important; border-right-style: none !important; border-right-width: 1px !important; border-top-color: rgb(222, 222, 222) !important; border-top-style: none !important; border-top-width: 1px !important; border-width: initial !important; color: rgb(68, 68, 68) !important; font-size: 12px !important; font: normal normal normal 12px/normal &#39;Bitstream Vera Sans Mono&#39;, Courier, monospace; margin-bottom: 0px; margin-left: 0px; margin-right: 0px; margin-top: 0px; padding-bottom: 0px !important; padding-left: 0px !important; padding-right: 0px !important; padding-top: 0px !important;&quot;&gt;Squeel.configure do |config|
  config.load_core_extensions :symbol
end

Person.joins(:articles =&amp;gt; :comments).
       where(:articles =&amp;gt; {:comments =&amp;gt; {:body.matches =&amp;gt; &#39;Hello!&#39;}})
SELECT &quot;people&quot;.* FROM &quot;people&quot; 
INNER JOIN &quot;articles&quot; ON &quot;articles&quot;.&quot;person_id&quot; = &quot;people&quot;.&quot;id&quot; 
INNER JOIN &quot;comments&quot; ON &quot;comments&quot;.&quot;article_id&quot; = &quot;articles&quot;.&quot;id&quot; 
WHERE &quot;comments&quot;.&quot;body&quot; LIKE &#39;Hello!&#39;
&lt;/code&gt;&lt;/pre&gt;
&lt;div style=&quot;line-height: 1.5em !important; margin-bottom: 1em !important; margin-top: 1em !important; padding-bottom: 0px; padding-left: 0px; padding-right: 0px; padding-top: 0px;&quot;&gt;
This should help to smooth over the transition to the new DSL&lt;/div&gt;
&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://rorashish.blogspot.com/feeds/6660224044996331251/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://rorashish.blogspot.com/2011/09/squeel-replacement-for-metawhere-gem-in.html#comment-form' title='2 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/2936127337406425108/posts/default/6660224044996331251'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/2936127337406425108/posts/default/6660224044996331251'/><link rel='alternate' type='text/html' href='http://rorashish.blogspot.com/2011/09/squeel-replacement-for-metawhere-gem-in.html' title='Squeel: Replacement for metawhere Gem in Rails 3.1'/><author><name>Anonymous</name><uri>http://www.blogger.com/profile/14643110071701140642</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='16' height='16' src='https://img1.blogblog.com/img/b16-rounded.gif'/></author><thr:total>2</thr:total></entry><entry><id>tag:blogger.com,1999:blog-2936127337406425108.post-3603611094048687064</id><published>2011-09-29T11:13:00.000+05:30</published><updated>2011-09-29T11:13:30.426+05:30</updated><category scheme="http://www.blogger.com/atom/ns#" term="metawhere"/><category scheme="http://www.blogger.com/atom/ns#" term="rails search"/><category scheme="http://www.blogger.com/atom/ns#" term="ruby"/><category scheme="http://www.blogger.com/atom/ns#" term="ruby on rails search"/><title type='text'>MetaWhere Getting Started</title><content type='html'>&lt;div dir=&quot;ltr&quot; style=&quot;text-align: left;&quot; trbidi=&quot;on&quot;&gt;&lt;span class=&quot;Apple-style-span&quot; style=&quot;background-color: #f8f8f8; font-family: helvetica, arial, freesans, clean, sans-serif; font-size: 13px;&quot;&gt;&lt;/span&gt;&lt;br /&gt;
&lt;div style=&quot;line-height: 1.5em !important; margin-bottom: 1em !important; margin-top: 1em !important; padding-bottom: 0px; padding-left: 0px; padding-right: 0px; padding-top: 0px;&quot;&gt;In your Gemfile:&lt;/div&gt;&lt;pre style=&quot;-webkit-box-shadow: rgba(0, 0, 0, 0.0664063) 0px 1px 2px inset; background-color: #eeeeee; border-bottom-color: rgb(221, 221, 221); border-bottom-left-radius: 3px 3px; border-bottom-right-radius: 3px 3px; border-bottom-style: solid; border-bottom-width: 1px; border-left-color: rgb(221, 221, 221); border-left-style: solid; border-left-width: 1px; border-right-color: rgb(221, 221, 221); border-right-style: solid; border-right-width: 1px; border-top-color: rgb(221, 221, 221); border-top-left-radius: 3px 3px; border-top-right-radius: 3px 3px; border-top-style: solid; border-top-width: 1px; color: #444444; font-size: 12px; font: normal normal normal 12px/normal &#39;Bitstream Vera Sans Mono&#39;, Courier, monospace; margin-bottom: 1em; margin-top: 1em; overflow-x: auto; overflow-y: auto; padding-bottom: 5px; padding-left: 5px; padding-right: 5px; padding-top: 5px;&quot;&gt;gem &quot;meta_where&quot;  # Last officially released gem
# gem &quot;meta_where&quot;, :git =&amp;gt; &quot;git://github.com/ernie/meta_where.git&quot; # Track git repo&lt;/pre&gt;&lt;div style=&quot;line-height: 1.5em !important; margin-bottom: 1em !important; margin-top: 1em !important; padding-bottom: 0px; padding-left: 0px; padding-right: 0px; padding-top: 0px;&quot;&gt;or, to install as a plugin:&lt;/div&gt;&lt;pre style=&quot;-webkit-box-shadow: rgba(0, 0, 0, 0.0664063) 0px 1px 2px inset; background-color: #eeeeee; border-bottom-color: rgb(221, 221, 221); border-bottom-left-radius: 3px 3px; border-bottom-right-radius: 3px 3px; border-bottom-style: solid; border-bottom-width: 1px; border-left-color: rgb(221, 221, 221); border-left-style: solid; border-left-width: 1px; border-right-color: rgb(221, 221, 221); border-right-style: solid; border-right-width: 1px; border-top-color: rgb(221, 221, 221); border-top-left-radius: 3px 3px; border-top-right-radius: 3px 3px; border-top-style: solid; border-top-width: 1px; color: #444444; font-size: 12px; font: normal normal normal 12px/normal &#39;Bitstream Vera Sans Mono&#39;, Courier, monospace; margin-bottom: 1em; margin-top: 1em; overflow-x: auto; overflow-y: auto; padding-bottom: 5px; padding-left: 5px; padding-right: 5px; padding-top: 5px;&quot;&gt;rails plugin install git://github.com/ernie/meta_where.git&lt;/pre&gt;&lt;h2 style=&quot;border-bottom-width: 0px !important; border-color: initial !important; border-left-width: 0px !important; border-right-width: 0px !important; border-style: initial !important; border-top-color: rgb(224, 224, 224) !important; border-top-style: solid !important; border-top-width: 4px !important; font-size: 20px; margin-bottom: 1em; margin-left: 0px; margin-right: 0px; margin-top: 1.5em !important; padding-bottom: 0px; padding-left: 0px; padding-right: 0px; padding-top: 0.5em !important;&quot;&gt;Example usage&lt;/h2&gt;&lt;h3 style=&quot;border-bottom-width: 0px !important; border-color: initial !important; border-left-width: 0px !important; border-right-width: 0px !important; border-style: initial !important; border-top-width: 0px !important; margin-bottom: 1em; margin-left: 0px; margin-right: 0px; margin-top: 1em !important; padding-bottom: 0px; padding-left: 0px; padding-right: 0px; padding-top: 0px;&quot;&gt;Where&lt;/h3&gt;&lt;div style=&quot;line-height: 1.5em !important; margin-bottom: 1em !important; margin-top: 1em !important; padding-bottom: 0px; padding-left: 0px; padding-right: 0px; padding-top: 0px;&quot;&gt;You can use MetaWhere in your usual method chain:&lt;/div&gt;&lt;pre style=&quot;-webkit-box-shadow: rgba(0, 0, 0, 0.0664063) 0px 1px 2px inset; background-color: #eeeeee; border-bottom-color: rgb(221, 221, 221); border-bottom-left-radius: 3px 3px; border-bottom-right-radius: 3px 3px; border-bottom-style: solid; border-bottom-width: 1px; border-left-color: rgb(221, 221, 221); border-left-style: solid; border-left-width: 1px; border-right-color: rgb(221, 221, 221); border-right-style: solid; border-right-width: 1px; border-top-color: rgb(221, 221, 221); border-top-left-radius: 3px 3px; border-top-right-radius: 3px 3px; border-top-style: solid; border-top-width: 1px; color: #444444; font-size: 12px; font: normal normal normal 12px/normal &#39;Bitstream Vera Sans Mono&#39;, Courier, monospace; margin-bottom: 1em; margin-top: 1em; overflow-x: auto; overflow-y: auto; padding-bottom: 5px; padding-left: 5px; padding-right: 5px; padding-top: 5px;&quot;&gt;Article.where(:title.matches =&amp;gt; &#39;Hello%&#39;, :created_at.gt =&amp;gt; 3.days.ago)
=&amp;gt; SELECT &quot;articles&quot;.* FROM &quot;articles&quot; WHERE (&quot;articles&quot;.&quot;title&quot; LIKE &#39;Hello%&#39;)
   AND (&quot;articles&quot;.&quot;created_at&quot; &amp;gt; &#39;2010-04-12 18:39:32.592087&#39;)&lt;/pre&gt;&lt;h3 style=&quot;border-bottom-width: 0px !important; border-color: initial !important; border-left-width: 0px !important; border-right-width: 0px !important; border-style: initial !important; border-top-width: 0px !important; margin-bottom: 1em; margin-left: 0px; margin-right: 0px; margin-top: 1em !important; padding-bottom: 0px; padding-left: 0px; padding-right: 0px; padding-top: 0px;&quot;&gt;Find condition hash&lt;/h3&gt;&lt;div style=&quot;line-height: 1.5em !important; margin-bottom: 1em !important; margin-top: 1em !important; padding-bottom: 0px; padding-left: 0px; padding-right: 0px; padding-top: 0px;&quot;&gt;You can also use similar syntax in a conditions hash supplied to ActiveRecord::Base#find:&lt;/div&gt;&lt;pre style=&quot;-webkit-box-shadow: rgba(0, 0, 0, 0.0664063) 0px 1px 2px inset; background-color: #eeeeee; border-bottom-color: rgb(221, 221, 221); border-bottom-left-radius: 3px 3px; border-bottom-right-radius: 3px 3px; border-bottom-style: solid; border-bottom-width: 1px; border-left-color: rgb(221, 221, 221); border-left-style: solid; border-left-width: 1px; border-right-color: rgb(221, 221, 221); border-right-style: solid; border-right-width: 1px; border-top-color: rgb(221, 221, 221); border-top-left-radius: 3px 3px; border-top-right-radius: 3px 3px; border-top-style: solid; border-top-width: 1px; color: #444444; font-size: 12px; font: normal normal normal 12px/normal &#39;Bitstream Vera Sans Mono&#39;, Courier, monospace; margin-bottom: 1em; margin-top: 1em; overflow-x: auto; overflow-y: auto; padding-bottom: 5px; padding-left: 5px; padding-right: 5px; padding-top: 5px;&quot;&gt;Article.find(:all,
  :conditions =&amp;gt; {
    :title.matches =&amp;gt; &#39;Hello%&#39;,
    :created_at.gt =&amp;gt; 3.days.ago
  }
)&lt;/pre&gt;&lt;h3 style=&quot;border-bottom-width: 0px !important; border-color: initial !important; border-left-width: 0px !important; border-right-width: 0px !important; border-style: initial !important; border-top-width: 0px !important; margin-bottom: 1em; margin-left: 0px; margin-right: 0px; margin-top: 1em !important; padding-bottom: 0px; padding-left: 0px; padding-right: 0px; padding-top: 0px;&quot;&gt;Scopes&lt;/h3&gt;&lt;div style=&quot;line-height: 1.5em !important; margin-bottom: 1em !important; margin-top: 1em !important; padding-bottom: 0px; padding-left: 0px; padding-right: 0px; padding-top: 0px;&quot;&gt;They also work in named scopes as you would expect.&lt;/div&gt;&lt;pre style=&quot;-webkit-box-shadow: rgba(0, 0, 0, 0.0664063) 0px 1px 2px inset; background-color: #eeeeee; border-bottom-color: rgb(221, 221, 221); border-bottom-left-radius: 3px 3px; border-bottom-right-radius: 3px 3px; border-bottom-style: solid; border-bottom-width: 1px; border-left-color: rgb(221, 221, 221); border-left-style: solid; border-left-width: 1px; border-right-color: rgb(221, 221, 221); border-right-style: solid; border-right-width: 1px; border-top-color: rgb(221, 221, 221); border-top-left-radius: 3px 3px; border-top-right-radius: 3px 3px; border-top-style: solid; border-top-width: 1px; color: #444444; font-size: 12px; font: normal normal normal 12px/normal &#39;Bitstream Vera Sans Mono&#39;, Courier, monospace; margin-bottom: 1em; margin-top: 1em; overflow-x: auto; overflow-y: auto; padding-bottom: 5px; padding-left: 5px; padding-right: 5px; padding-top: 5px;&quot;&gt;class Article
  scope :recent, lambda {|v| where(:created_at.gt =&amp;gt; v.days.ago)}
end

Article.recent(14).to_sql
=&amp;gt; SELECT &quot;articles&quot;.* FROM &quot;articles&quot;
   WHERE (&quot;articles&quot;.&quot;created_at&quot; &amp;gt; &#39;2010-04-01 18:54:37.030951&#39;)&lt;/pre&gt;&lt;h3 style=&quot;border-bottom-width: 0px !important; border-color: initial !important; border-left-width: 0px !important; border-right-width: 0px !important; border-style: initial !important; border-top-width: 0px !important; margin-bottom: 1em; margin-left: 0px; margin-right: 0px; margin-top: 1em !important; padding-bottom: 0px; padding-left: 0px; padding-right: 0px; padding-top: 0px;&quot;&gt;Operators (Optionally)&lt;/h3&gt;&lt;div style=&quot;line-height: 1.5em !important; margin-bottom: 1em !important; margin-top: 1em !important; padding-bottom: 0px; padding-left: 0px; padding-right: 0px; padding-top: 0px;&quot;&gt;Additionally, you can use certain operators as shorthand for certain Arel predication methods.&lt;/div&gt;&lt;div style=&quot;line-height: 1.5em !important; margin-bottom: 1em !important; margin-top: 1em !important; padding-bottom: 0px; padding-left: 0px; padding-right: 0px; padding-top: 0px;&quot;&gt;These are disabled by default, but can be enabled by calling MetaWhere.operator_overload! during your app’s initialization process.&lt;/div&gt;&lt;div style=&quot;line-height: 1.5em !important; margin-bottom: 1em !important; margin-top: 1em !important; padding-bottom: 0px; padding-left: 0px; padding-right: 0px; padding-top: 0px;&quot;&gt;These are experimental at this point and subject to change. Keep in mind that if you don’t want to enclose other conditions in {}, you should place operator conditions before any hash conditions.&lt;/div&gt;&lt;pre style=&quot;-webkit-box-shadow: rgba(0, 0, 0, 0.0664063) 0px 1px 2px inset; background-color: #eeeeee; border-bottom-color: rgb(221, 221, 221); border-bottom-left-radius: 3px 3px; border-bottom-right-radius: 3px 3px; border-bottom-style: solid; border-bottom-width: 1px; border-left-color: rgb(221, 221, 221); border-left-style: solid; border-left-width: 1px; border-right-color: rgb(221, 221, 221); border-right-style: solid; border-right-width: 1px; border-top-color: rgb(221, 221, 221); border-top-left-radius: 3px 3px; border-top-right-radius: 3px 3px; border-top-style: solid; border-top-width: 1px; color: #444444; font-size: 12px; font: normal normal normal 12px/normal &#39;Bitstream Vera Sans Mono&#39;, Courier, monospace; margin-bottom: 1em; margin-top: 1em; overflow-x: auto; overflow-y: auto; padding-bottom: 5px; padding-left: 5px; padding-right: 5px; padding-top: 5px;&quot;&gt;Article.where(:created_at &amp;gt; 100.days.ago, :title =~ &#39;Hi%&#39;).to_sql
=&amp;gt; SELECT &quot;articles&quot;.* FROM &quot;articles&quot;
   WHERE (&quot;articles&quot;.&quot;created_at&quot; &amp;gt; &#39;2010-01-05 20:11:44.997446&#39;)
   AND (&quot;articles&quot;.&quot;title&quot; LIKE &#39;Hi%&#39;)&lt;/pre&gt;&lt;div style=&quot;line-height: 1.5em !important; margin-bottom: 1em !important; margin-top: 1em !important; padding-bottom: 0px; padding-left: 0px; padding-right: 0px; padding-top: 0px;&quot;&gt;Operators are:&lt;/div&gt;&lt;ul style=&quot;margin-bottom: 1em !important; margin-left: 2em !important; margin-right: 0px !important; margin-top: 1em !important; padding-bottom: 0px; padding-left: 0px; padding-right: 0px; padding-top: 0px;&quot;&gt;&lt;li style=&quot;margin-bottom: 0.5em; margin-left: 0px; margin-right: 0px; margin-top: 0.5em; padding-bottom: 0px; padding-left: 0px; padding-right: 0px; padding-top: 0px;&quot;&gt;&lt;div style=&quot;line-height: 1.5em !important; margin-bottom: 1em !important; margin-top: 1em !important; padding-bottom: 0px; padding-left: 0px; padding-right: 0px; padding-top: 0px;&quot;&gt;&amp;gt;&amp;gt; (equal)&lt;/div&gt;&lt;/li&gt;
&lt;li style=&quot;margin-bottom: 0.5em; margin-left: 0px; margin-right: 0px; margin-top: 0.5em; padding-bottom: 0px; padding-left: 0px; padding-right: 0px; padding-top: 0px;&quot;&gt;&lt;div style=&quot;line-height: 1.5em !important; margin-bottom: 1em !important; margin-top: 1em !important; padding-bottom: 0px; padding-left: 0px; padding-right: 0px; padding-top: 0px;&quot;&gt;^ (not equal)&lt;/div&gt;&lt;/li&gt;
&lt;li style=&quot;margin-bottom: 0.5em; margin-left: 0px; margin-right: 0px; margin-top: 0.5em; padding-bottom: 0px; padding-left: 0px; padding-right: 0px; padding-top: 0px;&quot;&gt;&lt;div style=&quot;line-height: 1.5em !important; margin-bottom: 1em !important; margin-top: 1em !important; padding-bottom: 0px; padding-left: 0px; padding-right: 0px; padding-top: 0px;&quot;&gt;+ (in array/range)&lt;/div&gt;&lt;/li&gt;
&lt;li style=&quot;margin-bottom: 0.5em; margin-left: 0px; margin-right: 0px; margin-top: 0.5em; padding-bottom: 0px; padding-left: 0px; padding-right: 0px; padding-top: 0px;&quot;&gt;&lt;ul style=&quot;margin-bottom: 0px !important; margin-left: 2em !important; margin-right: 0px !important; margin-top: 0px !important; padding-bottom: 0px; padding-left: 0px; padding-right: 0px; padding-top: 0px;&quot;&gt;&lt;li style=&quot;margin-bottom: 0.5em; margin-left: 0px; margin-right: 0px; margin-top: 0.5em; padding-bottom: 0px; padding-left: 0px; padding-right: 0px; padding-top: 0px;&quot;&gt;&lt;div style=&quot;line-height: 1.5em !important; margin-bottom: 1em !important; margin-top: 1em !important; padding-bottom: 0px; padding-left: 0px; padding-right: 0px; padding-top: 0px;&quot;&gt;(not in array/range)&lt;/div&gt;&lt;/li&gt;
&lt;/ul&gt;&lt;/li&gt;
&lt;li style=&quot;margin-bottom: 0.5em; margin-left: 0px; margin-right: 0px; margin-top: 0.5em; padding-bottom: 0px; padding-left: 0px; padding-right: 0px; padding-top: 0px;&quot;&gt;&lt;div style=&quot;line-height: 1.5em !important; margin-bottom: 1em !important; margin-top: 1em !important; padding-bottom: 0px; padding-left: 0px; padding-right: 0px; padding-top: 0px;&quot;&gt;!~ (not matching, only available under Ruby 1.9)&lt;/div&gt;&lt;/li&gt;
&lt;li style=&quot;margin-bottom: 0.5em; margin-left: 0px; margin-right: 0px; margin-top: 0.5em; padding-bottom: 0px; padding-left: 0px; padding-right: 0px; padding-top: 0px;&quot;&gt;&lt;div style=&quot;line-height: 1.5em !important; margin-bottom: 1em !important; margin-top: 1em !important; padding-bottom: 0px; padding-left: 0px; padding-right: 0px; padding-top: 0px;&quot;&gt;&amp;gt; (greater than)&lt;/div&gt;&lt;/li&gt;
&lt;li style=&quot;margin-bottom: 0.5em; margin-left: 0px; margin-right: 0px; margin-top: 0.5em; padding-bottom: 0px; padding-left: 0px; padding-right: 0px; padding-top: 0px;&quot;&gt;&lt;div style=&quot;line-height: 1.5em !important; margin-bottom: 1em !important; margin-top: 1em !important; padding-bottom: 0px; padding-left: 0px; padding-right: 0px; padding-top: 0px;&quot;&gt;&amp;gt;= (greater than or equal to)&lt;/div&gt;&lt;/li&gt;
&lt;li style=&quot;margin-bottom: 0.5em; margin-left: 0px; margin-right: 0px; margin-top: 0.5em; padding-bottom: 0px; padding-left: 0px; padding-right: 0px; padding-top: 0px;&quot;&gt;&lt;div style=&quot;line-height: 1.5em !important; margin-bottom: 1em !important; margin-top: 1em !important; padding-bottom: 0px; padding-left: 0px; padding-right: 0px; padding-top: 0px;&quot;&gt;&amp;lt; (less than)&lt;/div&gt;&lt;/li&gt;
&lt;li style=&quot;margin-bottom: 0.5em; margin-left: 0px; margin-right: 0px; margin-top: 0.5em; padding-bottom: 0px; padding-left: 0px; padding-right: 0px; padding-top: 0px;&quot;&gt;&lt;div style=&quot;line-height: 1.5em !important; margin-bottom: 1em !important; margin-top: 1em !important; padding-bottom: 0px; padding-left: 0px; padding-right: 0px; padding-top: 0px;&quot;&gt;&amp;lt;= (less than or equal to)&lt;/div&gt;&lt;/li&gt;
&lt;li style=&quot;margin-bottom: 0.5em; margin-left: 0px; margin-right: 0px; margin-top: 0.5em; padding-bottom: 0px; padding-left: 0px; padding-right: 0px; padding-top: 0px;&quot;&gt;&lt;br /&gt;
&lt;dl style=&quot;margin-bottom: 0px; margin-left: 0px; margin-right: 0px; margin-top: 0px; padding-bottom: 0px; padding-left: 0px; padding-right: 0px; padding-top: 0px;&quot;&gt;&lt;dt style=&quot;font-weight: bold !important; margin-bottom: 0px; margin-left: 1em !important; margin-right: 0px; margin-top: 0px; padding-bottom: 0px; padding-left: 0px; padding-right: 0px; padding-top: 0px;&quot;&gt;&lt;/dt&gt;
&lt;dd style=&quot;margin-bottom: 1em !important; margin-left: 2em !important; margin-right: 0px; margin-top: 0px; padding-bottom: 0px; padding-left: 0px; padding-right: 0px; padding-top: 0px;&quot;&gt;&lt;div style=&quot;line-height: 1.5em !important; margin-bottom: 1em !important; margin-top: 1em !important; padding-bottom: 0px; padding-left: 0px; padding-right: 0px; padding-top: 0px;&quot;&gt;(SQL functions – more on those below)&lt;/div&gt;&lt;/dd&gt;&lt;/dl&gt;&lt;/li&gt;&lt;br /&gt;
&lt;/ul&gt;&lt;h3 style=&quot;border-bottom-width: 0px !important; border-color: initial !important; border-left-width: 0px !important; border-right-width: 0px !important; border-style: initial !important; border-top-width: 0px !important; margin-bottom: 1em; margin-left: 0px; margin-right: 0px; margin-top: 1em !important; padding-bottom: 0px; padding-left: 0px; padding-right: 0px; padding-top: 0px;&quot;&gt;Compounds&lt;/h3&gt;&lt;div style=&quot;line-height: 1.5em !important; margin-bottom: 1em !important; margin-top: 1em !important; padding-bottom: 0px; padding-left: 0px; padding-right: 0px; padding-top: 0px;&quot;&gt;You can use the &amp;amp; and | operators to perform ands and ors within your queries.&lt;/div&gt;&lt;div style=&quot;line-height: 1.5em !important; margin-bottom: 1em !important; margin-top: 1em !important; padding-bottom: 0px; padding-left: 0px; padding-right: 0px; padding-top: 0px;&quot;&gt;&lt;b style=&quot;margin-bottom: 0px; margin-left: 0px; margin-right: 0px; margin-top: 0px; padding-bottom: 0px; padding-left: 0px; padding-right: 0px; padding-top: 0px;&quot;&gt;With operators:&lt;/b&gt;&lt;/div&gt;&lt;pre style=&quot;-webkit-box-shadow: rgba(0, 0, 0, 0.0664063) 0px 1px 2px inset; background-color: #eeeeee; border-bottom-color: rgb(221, 221, 221); border-bottom-left-radius: 3px 3px; border-bottom-right-radius: 3px 3px; border-bottom-style: solid; border-bottom-width: 1px; border-left-color: rgb(221, 221, 221); border-left-style: solid; border-left-width: 1px; border-right-color: rgb(221, 221, 221); border-right-style: solid; border-right-width: 1px; border-top-color: rgb(221, 221, 221); border-top-left-radius: 3px 3px; border-top-right-radius: 3px 3px; border-top-style: solid; border-top-width: 1px; color: #444444; font-size: 12px; font: normal normal normal 12px/normal &#39;Bitstream Vera Sans Mono&#39;, Courier, monospace; margin-bottom: 1em; margin-top: 1em; overflow-x: auto; overflow-y: auto; padding-bottom: 5px; padding-left: 5px; padding-right: 5px; padding-top: 5px;&quot;&gt;Article.where((:title =~ &#39;Hello%&#39;) | (:title =~ &#39;Goodbye%&#39;)).to_sql
=&amp;gt; SELECT &quot;articles&quot;.* FROM &quot;articles&quot; WHERE ((&quot;articles&quot;.&quot;title&quot; LIKE &#39;Hello%&#39;
   OR &quot;articles&quot;.&quot;title&quot; LIKE &#39;Goodbye%&#39;))&lt;/pre&gt;&lt;div style=&quot;line-height: 1.5em !important; margin-bottom: 1em !important; margin-top: 1em !important; padding-bottom: 0px; padding-left: 0px; padding-right: 0px; padding-top: 0px;&quot;&gt;That’s kind of annoying, since operator precedence is such that you have to put parentheses around everything. So MetaWhere also supports a substitution-inspired (String#%) syntax.&lt;/div&gt;&lt;div style=&quot;line-height: 1.5em !important; margin-bottom: 1em !important; margin-top: 1em !important; padding-bottom: 0px; padding-left: 0px; padding-right: 0px; padding-top: 0px;&quot;&gt;&lt;b style=&quot;margin-bottom: 0px; margin-left: 0px; margin-right: 0px; margin-top: 0px; padding-bottom: 0px; padding-left: 0px; padding-right: 0px; padding-top: 0px;&quot;&gt;With “substitutions”:&lt;/b&gt;&lt;/div&gt;&lt;pre style=&quot;-webkit-box-shadow: rgba(0, 0, 0, 0.0664063) 0px 1px 2px inset; background-color: #eeeeee; border-bottom-color: rgb(221, 221, 221); border-bottom-left-radius: 3px 3px; border-bottom-right-radius: 3px 3px; border-bottom-style: solid; border-bottom-width: 1px; border-left-color: rgb(221, 221, 221); border-left-style: solid; border-left-width: 1px; border-right-color: rgb(221, 221, 221); border-right-style: solid; border-right-width: 1px; border-top-color: rgb(221, 221, 221); border-top-left-radius: 3px 3px; border-top-right-radius: 3px 3px; border-top-style: solid; border-top-width: 1px; color: #444444; font-size: 12px; font: normal normal normal 12px/normal &#39;Bitstream Vera Sans Mono&#39;, Courier, monospace; margin-bottom: 1em; margin-top: 1em; overflow-x: auto; overflow-y: auto; padding-bottom: 5px; padding-left: 5px; padding-right: 5px; padding-top: 5px;&quot;&gt;Article.where(:title.matches % &#39;Hello%&#39; | :title.matches % &#39;Goodbye%&#39;).to_sql
=&amp;gt; SELECT &quot;articles&quot;.* FROM &quot;articles&quot; WHERE ((&quot;articles&quot;.&quot;title&quot; LIKE &#39;Hello%&#39;
   OR &quot;articles&quot;.&quot;title&quot; LIKE &#39;Goodbye%&#39;))&lt;/pre&gt;&lt;div style=&quot;line-height: 1.5em !important; margin-bottom: 1em !important; margin-top: 1em !important; padding-bottom: 0px; padding-left: 0px; padding-right: 0px; padding-top: 0px;&quot;&gt;&lt;b style=&quot;margin-bottom: 0px; margin-left: 0px; margin-right: 0px; margin-top: 0px; padding-bottom: 0px; padding-left: 0px; padding-right: 0px; padding-top: 0px;&quot;&gt;With hashes:&lt;/b&gt;&lt;/div&gt;&lt;pre style=&quot;-webkit-box-shadow: rgba(0, 0, 0, 0.0664063) 0px 1px 2px inset; background-color: #eeeeee; border-bottom-color: rgb(221, 221, 221); border-bottom-left-radius: 3px 3px; border-bottom-right-radius: 3px 3px; border-bottom-style: solid; border-bottom-width: 1px; border-left-color: rgb(221, 221, 221); border-left-style: solid; border-left-width: 1px; border-right-color: rgb(221, 221, 221); border-right-style: solid; border-right-width: 1px; border-top-color: rgb(221, 221, 221); border-top-left-radius: 3px 3px; border-top-right-radius: 3px 3px; border-top-style: solid; border-top-width: 1px; color: #444444; font-size: 12px; font: normal normal normal 12px/normal &#39;Bitstream Vera Sans Mono&#39;, Courier, monospace; margin-bottom: 1em; margin-top: 1em; overflow-x: auto; overflow-y: auto; padding-bottom: 5px; padding-left: 5px; padding-right: 5px; padding-top: 5px;&quot;&gt;Article.where(
  {:created_at.lt =&amp;gt; Time.now} &amp;amp; {:created_at.gt =&amp;gt; 1.year.ago}
).to_sql
=&amp;gt; SELECT &quot;articles&quot;.* FROM &quot;articles&quot; WHERE
   (((&quot;articles&quot;.&quot;created_at&quot; &amp;lt; &#39;2010-04-16 00:26:30.629467&#39;)
   AND (&quot;articles&quot;.&quot;created_at&quot; &amp;gt; &#39;2009-04-16 00:26:30.629526&#39;)))&lt;/pre&gt;&lt;div style=&quot;line-height: 1.5em !important; margin-bottom: 1em !important; margin-top: 1em !important; padding-bottom: 0px; padding-left: 0px; padding-right: 0px; padding-top: 0px;&quot;&gt;&lt;b style=&quot;margin-bottom: 0px; margin-left: 0px; margin-right: 0px; margin-top: 0px; padding-bottom: 0px; padding-left: 0px; padding-right: 0px; padding-top: 0px;&quot;&gt;With both hashes and substitutions:&lt;/b&gt;&lt;/div&gt;&lt;pre style=&quot;-webkit-box-shadow: rgba(0, 0, 0, 0.0664063) 0px 1px 2px inset; background-color: #eeeeee; border-bottom-color: rgb(221, 221, 221); border-bottom-left-radius: 3px 3px; border-bottom-right-radius: 3px 3px; border-bottom-style: solid; border-bottom-width: 1px; border-left-color: rgb(221, 221, 221); border-left-style: solid; border-left-width: 1px; border-right-color: rgb(221, 221, 221); border-right-style: solid; border-right-width: 1px; border-top-color: rgb(221, 221, 221); border-top-left-radius: 3px 3px; border-top-right-radius: 3px 3px; border-top-style: solid; border-top-width: 1px; color: #444444; font-size: 12px; font: normal normal normal 12px/normal &#39;Bitstream Vera Sans Mono&#39;, Courier, monospace; margin-bottom: 1em; margin-top: 1em; overflow-x: auto; overflow-y: auto; padding-bottom: 5px; padding-left: 5px; padding-right: 5px; padding-top: 5px;&quot;&gt;Article.where(
  :title.matches % &#39;Hello%&#39; &amp;amp;
  {:created_at.lt =&amp;gt; Time.now, :created_at.gt =&amp;gt; 1.year.ago}
).to_sql
=&amp;gt; SELECT &quot;articles&quot;.* FROM  &quot;articles&quot; WHERE ((&quot;articles&quot;.&quot;title&quot; LIKE &#39;Hello%&#39; AND
   (&quot;articles&quot;.&quot;created_at&quot; &amp;lt; &#39;2010-04-16 01:04:38.023615&#39; AND
    &quot;articles&quot;.&quot;created_at&quot; &amp;gt; &#39;2009-04-16 01:04:38.023720&#39;)))&lt;/pre&gt;&lt;div style=&quot;line-height: 1.5em !important; margin-bottom: 1em !important; margin-top: 1em !important; padding-bottom: 0px; padding-left: 0px; padding-right: 0px; padding-top: 0px;&quot;&gt;&lt;b style=&quot;margin-bottom: 0px; margin-left: 0px; margin-right: 0px; margin-top: 0px; padding-bottom: 0px; padding-left: 0px; padding-right: 0px; padding-top: 0px;&quot;&gt;With insanity… errr, complex combinations(*):&lt;/b&gt;&lt;/div&gt;&lt;pre style=&quot;-webkit-box-shadow: rgba(0, 0, 0, 0.0664063) 0px 1px 2px inset; background-color: #eeeeee; border-bottom-color: rgb(221, 221, 221); border-bottom-left-radius: 3px 3px; border-bottom-right-radius: 3px 3px; border-bottom-style: solid; border-bottom-width: 1px; border-left-color: rgb(221, 221, 221); border-left-style: solid; border-left-width: 1px; border-right-color: rgb(221, 221, 221); border-right-style: solid; border-right-width: 1px; border-top-color: rgb(221, 221, 221); border-top-left-radius: 3px 3px; border-top-right-radius: 3px 3px; border-top-style: solid; border-top-width: 1px; color: #444444; font-size: 12px; font: normal normal normal 12px/normal &#39;Bitstream Vera Sans Mono&#39;, Courier, monospace; margin-bottom: 1em; margin-top: 1em; overflow-x: auto; overflow-y: auto; padding-bottom: 5px; padding-left: 5px; padding-right: 5px; padding-top: 5px;&quot;&gt;Article.joins(:comments).where(
  {:title =&amp;gt; &#39;Greetings&#39;} |
  (
    (
      :created_at.gt % 21.days.ago &amp;amp;
      :created_at.lt % 7.days.ago
    ) &amp;amp;
    :body.matches % &#39;%from the past%&#39;
  ) &amp;amp;
  {:comments =&amp;gt; [:body =~ &#39;%first post!%&#39;]}
).to_sql
=&amp;gt; SELECT &quot;articles&quot;.*
   FROM &quot;articles&quot;
     INNER JOIN &quot;comments&quot;
     ON &quot;comments&quot;.&quot;article_id&quot; = &quot;articles&quot;.&quot;id&quot;
   WHERE
   ((
     &quot;articles&quot;.&quot;title&quot; = &#39;Greetings&#39;
     OR
     (
       (
         (
           &quot;articles&quot;.&quot;created_at&quot; &amp;gt; &#39;2010-03-26 05:57:57.924258&#39;
           AND &quot;articles&quot;.&quot;created_at&quot; &amp;lt; &#39;2010-04-09 05:57:57.924984&#39;
         )
         AND &quot;articles&quot;.&quot;body&quot; LIKE &#39;%from the past%&#39;
       )
       AND &quot;comments&quot;.&quot;body&quot; LIKE &#39;%first post!%&#39;
     )
   ))&lt;/pre&gt;&lt;div style=&quot;line-height: 1.5em !important; margin-bottom: 1em !important; margin-top: 1em !important; padding-bottom: 0px; padding-left: 0px; padding-right: 0px; padding-top: 0px;&quot;&gt;(*) Formatting added for clarity. I said you could do this, not that you should. :)&lt;/div&gt;&lt;h2 style=&quot;border-bottom-width: 0px !important; border-color: initial !important; border-left-width: 0px !important; border-right-width: 0px !important; border-style: initial !important; border-top-color: rgb(224, 224, 224) !important; border-top-style: solid !important; border-top-width: 4px !important; font-size: 20px; margin-bottom: 1em; margin-left: 0px; margin-right: 0px; margin-top: 1.5em !important; padding-bottom: 0px; padding-left: 0px; padding-right: 0px; padding-top: 0.5em !important;&quot;&gt;Join type specification&lt;/h2&gt;&lt;div style=&quot;line-height: 1.5em !important; margin-bottom: 1em !important; margin-top: 1em !important; padding-bottom: 0px; padding-left: 0px; padding-right: 0px; padding-top: 0px;&quot;&gt;You can choose whether to use an inner join (the default) or a left outer join by tacking&amp;nbsp;&lt;tt style=&quot;margin-bottom: 0px; margin-left: 0px; margin-right: 0px; margin-top: 0px; padding-bottom: 0px; padding-left: 0px; padding-right: 0px; padding-top: 0px;&quot;&gt;.outer&lt;/tt&gt;&amp;nbsp;or&amp;nbsp;&lt;tt style=&quot;margin-bottom: 0px; margin-left: 0px; margin-right: 0px; margin-top: 0px; padding-bottom: 0px; padding-left: 0px; padding-right: 0px; padding-top: 0px;&quot;&gt;.inner&lt;/tt&gt;&amp;nbsp;to the symbols specified in your joins() call:&lt;/div&gt;&lt;pre style=&quot;-webkit-box-shadow: rgba(0, 0, 0, 0.0664063) 0px 1px 2px inset; background-color: #eeeeee; border-bottom-color: rgb(221, 221, 221); border-bottom-left-radius: 3px 3px; border-bottom-right-radius: 3px 3px; border-bottom-style: solid; border-bottom-width: 1px; border-left-color: rgb(221, 221, 221); border-left-style: solid; border-left-width: 1px; border-right-color: rgb(221, 221, 221); border-right-style: solid; border-right-width: 1px; border-top-color: rgb(221, 221, 221); border-top-left-radius: 3px 3px; border-top-right-radius: 3px 3px; border-top-style: solid; border-top-width: 1px; color: #444444; font-size: 12px; font: normal normal normal 12px/normal &#39;Bitstream Vera Sans Mono&#39;, Courier, monospace; margin-bottom: 1em; margin-top: 1em; overflow-x: auto; overflow-y: auto; padding-bottom: 5px; padding-left: 5px; padding-right: 5px; padding-top: 5px;&quot;&gt;Article.joins(:comments =&amp;gt; :moderations.outer).to_sql
=&amp;gt; SELECT &quot;articles&quot;.* FROM &quot;articles&quot;
   INNER JOIN &quot;comments&quot; ON &quot;comments&quot;.&quot;article_id&quot; = &quot;articles&quot;.&quot;id&quot;
   LEFT OUTER JOIN &quot;moderations&quot; ON &quot;moderations&quot;.&quot;comment_id&quot; = &quot;comments&quot;.&quot;id&quot;&lt;/pre&gt;&lt;h2 style=&quot;border-bottom-width: 0px !important; border-color: initial !important; border-left-width: 0px !important; border-right-width: 0px !important; border-style: initial !important; border-top-color: rgb(224, 224, 224) !important; border-top-style: solid !important; border-top-width: 4px !important; font-size: 20px; margin-bottom: 1em; margin-left: 0px; margin-right: 0px; margin-top: 1.5em !important; padding-bottom: 0px; padding-left: 0px; padding-right: 0px; padding-top: 0.5em !important;&quot;&gt;SQL Functions&lt;/h2&gt;&lt;div style=&quot;line-height: 1.5em !important; margin-bottom: 1em !important; margin-top: 1em !important; padding-bottom: 0px; padding-left: 0px; padding-right: 0px; padding-top: 0px;&quot;&gt;You can use SQL functions in your queries:&lt;/div&gt;&lt;pre style=&quot;-webkit-box-shadow: rgba(0, 0, 0, 0.0664063) 0px 1px 2px inset; background-color: #eeeeee; border-bottom-color: rgb(221, 221, 221); border-bottom-left-radius: 3px 3px; border-bottom-right-radius: 3px 3px; border-bottom-style: solid; border-bottom-width: 1px; border-left-color: rgb(221, 221, 221); border-left-style: solid; border-left-width: 1px; border-right-color: rgb(221, 221, 221); border-right-style: solid; border-right-width: 1px; border-top-color: rgb(221, 221, 221); border-top-left-radius: 3px 3px; border-top-right-radius: 3px 3px; border-top-style: solid; border-top-width: 1px; color: #444444; font-size: 12px; font: normal normal normal 12px/normal &#39;Bitstream Vera Sans Mono&#39;, Courier, monospace; margin-bottom: 1em; margin-top: 1em; overflow-x: auto; overflow-y: auto; padding-bottom: 5px; padding-left: 5px; padding-right: 5px; padding-top: 5px;&quot;&gt;Manager.joins(:employees.outer).group(&#39;managers.id&#39;).
        having(:employees =&amp;gt; (:count.func(:id) &amp;lt; 3))
=&amp;gt; SELECT &quot;managers&quot;.* FROM &quot;managers&quot;
   LEFT OUTER JOIN &quot;employees&quot; ON &quot;employees&quot;.&quot;manager_id&quot; = &quot;managers&quot;.&quot;id&quot;
   GROUP BY managers.id HAVING count(&quot;employees&quot;.&quot;id&quot;) &amp;lt; 3&lt;/pre&gt;&lt;div style=&quot;line-height: 1.5em !important; margin-bottom: 1em !important; margin-top: 1em !important; padding-bottom: 0px; padding-left: 0px; padding-right: 0px; padding-top: 0px;&quot;&gt;If you enable Symbol operators, you can just use&amp;nbsp;&lt;tt style=&quot;margin-bottom: 0px; margin-left: 0px; margin-right: 0px; margin-top: 0px; padding-bottom: 0px; padding-left: 0px; padding-right: 0px; padding-top: 0px;&quot;&gt;:count[:id]&lt;/tt&gt;, instead of calling&amp;nbsp;&lt;tt style=&quot;margin-bottom: 0px; margin-left: 0px; margin-right: 0px; margin-top: 0px; padding-bottom: 0px; padding-left: 0px; padding-right: 0px; padding-top: 0px;&quot;&gt;func&lt;/tt&gt;&amp;nbsp;as shown above. SQL functions work in the SELECT, WHERE, and HAVING clauses, and can be aliased with&amp;nbsp;&lt;tt style=&quot;margin-bottom: 0px; margin-left: 0px; margin-right: 0px; margin-top: 0px; padding-bottom: 0px; padding-left: 0px; padding-right: 0px; padding-top: 0px;&quot;&gt;as&lt;/tt&gt;:&lt;/div&gt;&lt;pre style=&quot;-webkit-box-shadow: rgba(0, 0, 0, 0.0664063) 0px 1px 2px inset; background-color: #eeeeee; border-bottom-color: rgb(221, 221, 221); border-bottom-left-radius: 3px 3px; border-bottom-right-radius: 3px 3px; border-bottom-style: solid; border-bottom-width: 1px; border-left-color: rgb(221, 221, 221); border-left-style: solid; border-left-width: 1px; border-right-color: rgb(221, 221, 221); border-right-style: solid; border-right-width: 1px; border-top-color: rgb(221, 221, 221); border-top-left-radius: 3px 3px; border-top-right-radius: 3px 3px; border-top-style: solid; border-top-width: 1px; color: #444444; font-size: 12px; font: normal normal normal 12px/normal &#39;Bitstream Vera Sans Mono&#39;, Courier, monospace; margin-bottom: 1em; margin-top: 1em; overflow-x: auto; overflow-y: auto; padding-bottom: 5px; padding-left: 5px; padding-right: 5px; padding-top: 5px;&quot;&gt;Manager.select(&#39;managers.*&#39;).
        select(:find_in_set[:id, &#39;3,2,1&#39;].as(&#39;position&#39;))
=&amp;gt; SELECT managers.*, find_in_set(&quot;managers&quot;.&quot;id&quot;,&#39;3,2,1&#39;) AS position
   FROM &quot;managers&quot;&lt;/pre&gt;&lt;h3 style=&quot;border-bottom-width: 0px !important; border-color: initial !important; border-left-width: 0px !important; border-right-width: 0px !important; border-style: initial !important; border-top-width: 0px !important; margin-bottom: 1em; margin-left: 0px; margin-right: 0px; margin-top: 1em !important; padding-bottom: 0px; padding-left: 0px; padding-right: 0px; padding-top: 0px;&quot;&gt;But wait, there’s more!&lt;/h3&gt;&lt;h2 style=&quot;border-bottom-width: 0px !important; border-color: initial !important; border-left-width: 0px !important; border-right-width: 0px !important; border-style: initial !important; border-top-color: rgb(224, 224, 224) !important; border-top-style: solid !important; border-top-width: 4px !important; font-size: 20px; margin-bottom: 1em; margin-left: 0px; margin-right: 0px; margin-top: 1.5em !important; padding-bottom: 0px; padding-left: 0px; padding-right: 0px; padding-top: 0.5em !important;&quot;&gt;Intelligent hash condition mapping&lt;/h2&gt;&lt;div style=&quot;line-height: 1.5em !important; margin-bottom: 1em !important; margin-top: 1em !important; padding-bottom: 0px; padding-left: 0px; padding-right: 0px; padding-top: 0px;&quot;&gt;This is one of those things I hope you find so intuitive that you forget it wasn’t built in already.&lt;/div&gt;&lt;div style=&quot;line-height: 1.5em !important; margin-bottom: 1em !important; margin-top: 1em !important; padding-bottom: 0px; padding-left: 0px; padding-right: 0px; padding-top: 0px;&quot;&gt;PredicateBuilder (the part of ActiveRecord responsible for turning your conditions hash into a valid SQL query) will allow you to nest conditions in order to specify a table that the conditions apply to:&lt;/div&gt;&lt;pre style=&quot;-webkit-box-shadow: rgba(0, 0, 0, 0.0664063) 0px 1px 2px inset; background-color: #eeeeee; border-bottom-color: rgb(221, 221, 221); border-bottom-left-radius: 3px 3px; border-bottom-right-radius: 3px 3px; border-bottom-style: solid; border-bottom-width: 1px; border-left-color: rgb(221, 221, 221); border-left-style: solid; border-left-width: 1px; border-right-color: rgb(221, 221, 221); border-right-style: solid; border-right-width: 1px; border-top-color: rgb(221, 221, 221); border-top-left-radius: 3px 3px; border-top-right-radius: 3px 3px; border-top-style: solid; border-top-width: 1px; color: #444444; font-size: 12px; font: normal normal normal 12px/normal &#39;Bitstream Vera Sans Mono&#39;, Courier, monospace; margin-bottom: 1em; margin-top: 1em; overflow-x: auto; overflow-y: auto; padding-bottom: 5px; padding-left: 5px; padding-right: 5px; padding-top: 5px;&quot;&gt;Article.joins(:comments).where(:comments =&amp;gt; {:body =&amp;gt; &#39;hey&#39;}).to_sql
=&amp;gt; SELECT &quot;articles&quot;.* FROM &quot;articles&quot; INNER JOIN &quot;comments&quot;
   ON &quot;comments&quot;.&quot;article_id&quot; = &quot;articles&quot;.&quot;id&quot;
   WHERE (&quot;comments&quot;.&quot;body&quot; = &#39;hey&#39;)&lt;/pre&gt;&lt;div style=&quot;line-height: 1.5em !important; margin-bottom: 1em !important; margin-top: 1em !important; padding-bottom: 0px; padding-left: 0px; padding-right: 0px; padding-top: 0px;&quot;&gt;This feels pretty magical at first, but the magic quickly breaks down. Consider an association named&amp;nbsp;&lt;tt style=&quot;margin-bottom: 0px; margin-left: 0px; margin-right: 0px; margin-top: 0px; padding-bottom: 0px; padding-left: 0px; padding-right: 0px; padding-top: 0px;&quot;&gt;:other_comments&lt;/tt&gt;&amp;nbsp;that is just a condition against comments:&lt;/div&gt;&lt;pre style=&quot;-webkit-box-shadow: rgba(0, 0, 0, 0.0664063) 0px 1px 2px inset; background-color: #eeeeee; border-bottom-color: rgb(221, 221, 221); border-bottom-left-radius: 3px 3px; border-bottom-right-radius: 3px 3px; border-bottom-style: solid; border-bottom-width: 1px; border-left-color: rgb(221, 221, 221); border-left-style: solid; border-left-width: 1px; border-right-color: rgb(221, 221, 221); border-right-style: solid; border-right-width: 1px; border-top-color: rgb(221, 221, 221); border-top-left-radius: 3px 3px; border-top-right-radius: 3px 3px; border-top-style: solid; border-top-width: 1px; color: #444444; font-size: 12px; font: normal normal normal 12px/normal &#39;Bitstream Vera Sans Mono&#39;, Courier, monospace; margin-bottom: 1em; margin-top: 1em; overflow-x: auto; overflow-y: auto; padding-bottom: 5px; padding-left: 5px; padding-right: 5px; padding-top: 5px;&quot;&gt;Article.joins(:other_comments).where(:other_comments =&amp;gt; {:body =&amp;gt; &#39;hey&#39;}).to_sql
=&amp;gt; ActiveRecord::StatementInvalid: No attribute named `body` exists for table `other_comments`&lt;/pre&gt;&lt;div style=&quot;line-height: 1.5em !important; margin-bottom: 1em !important; margin-top: 1em !important; padding-bottom: 0px; padding-left: 0px; padding-right: 0px; padding-top: 0px;&quot;&gt;Ick. This is because the query is being created against tables, and not against associations. You’d need to do…&lt;/div&gt;&lt;pre style=&quot;-webkit-box-shadow: rgba(0, 0, 0, 0.0664063) 0px 1px 2px inset; background-color: #eeeeee; border-bottom-color: rgb(221, 221, 221); border-bottom-left-radius: 3px 3px; border-bottom-right-radius: 3px 3px; border-bottom-style: solid; border-bottom-width: 1px; border-left-color: rgb(221, 221, 221); border-left-style: solid; border-left-width: 1px; border-right-color: rgb(221, 221, 221); border-right-style: solid; border-right-width: 1px; border-top-color: rgb(221, 221, 221); border-top-left-radius: 3px 3px; border-top-right-radius: 3px 3px; border-top-style: solid; border-top-width: 1px; color: #444444; font-size: 12px; font: normal normal normal 12px/normal &#39;Bitstream Vera Sans Mono&#39;, Courier, monospace; margin-bottom: 1em; margin-top: 1em; overflow-x: auto; overflow-y: auto; padding-bottom: 5px; padding-left: 5px; padding-right: 5px; padding-top: 5px;&quot;&gt;Article.joins(:other_comments).where(:comments =&amp;gt; {:body =&amp;gt; &#39;hey&#39;})&lt;/pre&gt;&lt;div style=&quot;line-height: 1.5em !important; margin-bottom: 1em !important; margin-top: 1em !important; padding-bottom: 0px; padding-left: 0px; padding-right: 0px; padding-top: 0px;&quot;&gt;…instead.&lt;/div&gt;&lt;div style=&quot;line-height: 1.5em !important; margin-bottom: 1em !important; margin-top: 1em !important; padding-bottom: 0px; padding-left: 0px; padding-right: 0px; padding-top: 0px;&quot;&gt;With MetaWhere:&lt;/div&gt;&lt;pre style=&quot;-webkit-box-shadow: rgba(0, 0, 0, 0.0664063) 0px 1px 2px inset; background-color: #eeeeee; border-bottom-color: rgb(221, 221, 221); border-bottom-left-radius: 3px 3px; border-bottom-right-radius: 3px 3px; border-bottom-style: solid; border-bottom-width: 1px; border-left-color: rgb(221, 221, 221); border-left-style: solid; border-left-width: 1px; border-right-color: rgb(221, 221, 221); border-right-style: solid; border-right-width: 1px; border-top-color: rgb(221, 221, 221); border-top-left-radius: 3px 3px; border-top-right-radius: 3px 3px; border-top-style: solid; border-top-width: 1px; color: #444444; font-size: 12px; font: normal normal normal 12px/normal &#39;Bitstream Vera Sans Mono&#39;, Courier, monospace; margin-bottom: 1em; margin-top: 1em; overflow-x: auto; overflow-y: auto; padding-bottom: 5px; padding-left: 5px; padding-right: 5px; padding-top: 5px;&quot;&gt;Article.joins(:other_comments).where(:other_comments =&amp;gt; {:body =&amp;gt; &#39;hey&#39;}).to_sql
=&amp;gt; SELECT &quot;articles&quot;.* FROM &quot;articles&quot; INNER JOIN &quot;comments&quot;
   ON &quot;comments&quot;.&quot;article_id&quot; = &quot;articles&quot;.&quot;id&quot; WHERE ((&quot;comments&quot;.&quot;body&quot; = &#39;hey&#39;))&lt;/pre&gt;&lt;div style=&quot;line-height: 1.5em !important; margin-bottom: 1em !important; margin-top: 1em !important; padding-bottom: 0px; padding-left: 0px; padding-right: 0px; padding-top: 0px;&quot;&gt;The general idea is that if an association with the name provided exists, MetaWhere will build the conditions against that association’s table as it’s been aliased, before falling back to assuming you’re specifying a table by name. It also handles nested associations:&lt;/div&gt;&lt;pre style=&quot;-webkit-box-shadow: rgba(0, 0, 0, 0.0664063) 0px 1px 2px inset; background-color: #eeeeee; border-bottom-color: rgb(221, 221, 221); border-bottom-left-radius: 3px 3px; border-bottom-right-radius: 3px 3px; border-bottom-style: solid; border-bottom-width: 1px; border-left-color: rgb(221, 221, 221); border-left-style: solid; border-left-width: 1px; border-right-color: rgb(221, 221, 221); border-right-style: solid; border-right-width: 1px; border-top-color: rgb(221, 221, 221); border-top-left-radius: 3px 3px; border-top-right-radius: 3px 3px; border-top-style: solid; border-top-width: 1px; color: #444444; font-size: 12px; font: normal normal normal 12px/normal &#39;Bitstream Vera Sans Mono&#39;, Courier, monospace; margin-bottom: 1em; margin-top: 1em; overflow-x: auto; overflow-y: auto; padding-bottom: 5px; padding-left: 5px; padding-right: 5px; padding-top: 5px;&quot;&gt;Article.where(
  :comments =&amp;gt; {
    :body =&amp;gt; &#39;yo&#39;,
    :moderations =&amp;gt; [:value &amp;lt; 0]
  },
  :other_comments =&amp;gt; {:body =&amp;gt; &#39;hey&#39;}
).joins(
  {:comments =&amp;gt; :moderations},
  :other_comments
).to_sql
=&amp;gt; SELECT &quot;articles&quot;.* FROM &quot;articles&quot;
   INNER JOIN &quot;comments&quot; ON &quot;comments&quot;.&quot;article_id&quot; = &quot;articles&quot;.&quot;id&quot;
   INNER JOIN &quot;moderations&quot; ON &quot;moderations&quot;.&quot;comment_id&quot; = &quot;comments&quot;.&quot;id&quot;
   INNER JOIN &quot;comments&quot; &quot;other_comments_articles&quot;
     ON &quot;other_comments_articles&quot;.&quot;article_id&quot; = &quot;articles&quot;.&quot;id&quot;
  WHERE ((&quot;comments&quot;.&quot;body&quot; = &#39;yo&#39; AND &quot;moderations&quot;.&quot;value&quot; &amp;lt; 0
    AND &quot;other_comments_articles&quot;.&quot;body&quot; = &#39;hey&#39;))&lt;/pre&gt;&lt;div style=&quot;line-height: 1.5em !important; margin-bottom: 1em !important; margin-top: 1em !important; padding-bottom: 0px; padding-left: 0px; padding-right: 0px; padding-top: 0px;&quot;&gt;Contrived example, I’ll admit – but I’ll bet you can think of some uses for this.&lt;/div&gt;&lt;h2 style=&quot;border-bottom-width: 0px !important; border-color: initial !important; border-left-width: 0px !important; border-right-width: 0px !important; border-style: initial !important; border-top-color: rgb(224, 224, 224) !important; border-top-style: solid !important; border-top-width: 4px !important; font-size: 20px; margin-bottom: 1em; margin-left: 0px; margin-right: 0px; margin-top: 1.5em !important; padding-bottom: 0px; padding-left: 0px; padding-right: 0px; padding-top: 0.5em !important;&quot;&gt;Enhanced relation merges&lt;/h2&gt;&lt;div style=&quot;line-height: 1.5em !important; margin-bottom: 1em !important; margin-top: 1em !important; padding-bottom: 0px; padding-left: 0px; padding-right: 0px; padding-top: 0px;&quot;&gt;One of the changes MetaWhere makes to ActiveRecord is to delay “compiling” the where_values into actual Arel predicates until absolutely necessary. This allows for greater flexibility and last-second inference of associations/joins from any hashes supplied. A drawback of this method is that when merging relations, ActiveRecord just assumes that the values being merged are already firmed up against a specific table name and can just be thrown together. This isn’t the case with MetaWhere, and would cause unexpected failures when merging. However, MetaWhere improves on the default ActiveRecord merge functionality in two ways. First, when called with 1 parameter, (as is always the case when using the &amp;amp; alias) MetaWhere will try to determine if an association exists between the two models involved in the merge. If it does, the association name will be used to construct criteria.&lt;/div&gt;&lt;div style=&quot;line-height: 1.5em !important; margin-bottom: 1em !important; margin-top: 1em !important; padding-bottom: 0px; padding-left: 0px; padding-right: 0px; padding-top: 0px;&quot;&gt;Additionally, to cover times when detection is impossible, or the first detected association isn’t the one you wanted, you can call merge with a second parameter, specifying the association to be used during the merge.&lt;/div&gt;&lt;div style=&quot;line-height: 1.5em !important; margin-bottom: 1em !important; margin-top: 1em !important; padding-bottom: 0px; padding-left: 0px; padding-right: 0px; padding-top: 0px;&quot;&gt;This merge functionality allows you to do this…&lt;/div&gt;&lt;pre style=&quot;-webkit-box-shadow: rgba(0, 0, 0, 0.0664063) 0px 1px 2px inset; background-color: #eeeeee; border-bottom-color: rgb(221, 221, 221); border-bottom-left-radius: 3px 3px; border-bottom-right-radius: 3px 3px; border-bottom-style: solid; border-bottom-width: 1px; border-left-color: rgb(221, 221, 221); border-left-style: solid; border-left-width: 1px; border-right-color: rgb(221, 221, 221); border-right-style: solid; border-right-width: 1px; border-top-color: rgb(221, 221, 221); border-top-left-radius: 3px 3px; border-top-right-radius: 3px 3px; border-top-style: solid; border-top-width: 1px; color: #444444; font-size: 12px; font: normal normal normal 12px/normal &#39;Bitstream Vera Sans Mono&#39;, Courier, monospace; margin-bottom: 1em; margin-top: 1em; overflow-x: auto; overflow-y: auto; padding-bottom: 5px; padding-left: 5px; padding-right: 5px; padding-top: 5px;&quot;&gt;(Comment.where(:id &amp;lt; 7) &amp;amp; Article.where(:title =~ &#39;%blah%&#39;)).to_sql
=&amp;gt; SELECT &quot;comments&quot;.* FROM &quot;comments&quot; INNER JOIN &quot;articles&quot;
   ON &quot;articles&quot;.&quot;id&quot; = &quot;comments&quot;.&quot;article_id&quot;
   WHERE (&quot;comments&quot;.&quot;id&quot; &amp;lt; 7) AND (&quot;articles&quot;.&quot;title&quot; LIKE &#39;%blah%&#39;)&quot;&lt;/pre&gt;&lt;div style=&quot;line-height: 1.5em !important; margin-bottom: 1em !important; margin-top: 1em !important; padding-bottom: 0px; padding-left: 0px; padding-right: 0px; padding-top: 0px;&quot;&gt;…or this…&lt;/div&gt;&lt;pre style=&quot;-webkit-box-shadow: rgba(0, 0, 0, 0.0664063) 0px 1px 2px inset; background-color: #eeeeee; border-bottom-color: rgb(221, 221, 221); border-bottom-left-radius: 3px 3px; border-bottom-right-radius: 3px 3px; border-bottom-style: solid; border-bottom-width: 1px; border-left-color: rgb(221, 221, 221); border-left-style: solid; border-left-width: 1px; border-right-color: rgb(221, 221, 221); border-right-style: solid; border-right-width: 1px; border-top-color: rgb(221, 221, 221); border-top-left-radius: 3px 3px; border-top-right-radius: 3px 3px; border-top-style: solid; border-top-width: 1px; color: #444444; font-size: 12px; font: normal normal normal 12px/normal &#39;Bitstream Vera Sans Mono&#39;, Courier, monospace; margin-bottom: 1em; margin-top: 1em; overflow-x: auto; overflow-y: auto; padding-bottom: 5px; padding-left: 5px; padding-right: 5px; padding-top: 5px;&quot;&gt;Article.where(:id &amp;lt; 2).merge(Comment.where(:id &amp;lt; 7), :lame_comments).to_sql
=&amp;gt; &quot;SELECT &quot;articles&quot;.* FROM &quot;articles&quot;
   INNER JOIN &quot;comments&quot; ON &quot;comments&quot;.&quot;article_id&quot; = &quot;articles&quot;.&quot;id&quot;
      AND &quot;comments&quot;.&quot;body&quot; = &#39;first post!&#39;
   WHERE (&quot;articles&quot;.&quot;id&quot; &amp;lt; 2) AND (&quot;comments&quot;.&quot;id&quot; &amp;lt; 7)&quot;&lt;/pre&gt;&lt;h2 style=&quot;border-bottom-width: 0px !important; border-color: initial !important; border-left-width: 0px !important; border-right-width: 0px !important; border-style: initial !important; border-top-color: rgb(224, 224, 224) !important; border-top-style: solid !important; border-top-width: 4px !important; font-size: 20px; margin-bottom: 1em; margin-left: 0px; margin-right: 0px; margin-top: 1.5em !important; padding-bottom: 0px; padding-left: 0px; padding-right: 0px; padding-top: 0.5em !important;&quot;&gt;Enhanced order clauses&lt;/h2&gt;&lt;div style=&quot;line-height: 1.5em !important; margin-bottom: 1em !important; margin-top: 1em !important; padding-bottom: 0px; padding-left: 0px; padding-right: 0px; padding-top: 0px;&quot;&gt;If you are used to doing stuff like&amp;nbsp;&lt;tt style=&quot;margin-bottom: 0px; margin-left: 0px; margin-right: 0px; margin-top: 0px; padding-bottom: 0px; padding-left: 0px; padding-right: 0px; padding-top: 0px;&quot;&gt;Article.order(&#39;title asc&#39;)&lt;/tt&gt;, that will still work as you expect. However, if you pass symbols or arrays in to the&lt;tt style=&quot;margin-bottom: 0px; margin-left: 0px; margin-right: 0px; margin-top: 0px; padding-bottom: 0px; padding-left: 0px; padding-right: 0px; padding-top: 0px;&quot;&gt;order&lt;/tt&gt;&amp;nbsp;method, you can take advantage of intelligent association detection (as with “Intelligent hash condition mapping,” above) and also some convenience methods for ascending and descending sorts.&lt;/div&gt;&lt;pre style=&quot;-webkit-box-shadow: rgba(0, 0, 0, 0.0664063) 0px 1px 2px inset; background-color: #eeeeee; border-bottom-color: rgb(221, 221, 221); border-bottom-left-radius: 3px 3px; border-bottom-right-radius: 3px 3px; border-bottom-style: solid; border-bottom-width: 1px; border-left-color: rgb(221, 221, 221); border-left-style: solid; border-left-width: 1px; border-right-color: rgb(221, 221, 221); border-right-style: solid; border-right-width: 1px; border-top-color: rgb(221, 221, 221); border-top-left-radius: 3px 3px; border-top-right-radius: 3px 3px; border-top-style: solid; border-top-width: 1px; color: #444444; font-size: 12px; font: normal normal normal 12px/normal &#39;Bitstream Vera Sans Mono&#39;, Courier, monospace; margin-bottom: 1em; margin-top: 1em; overflow-x: auto; overflow-y: auto; padding-bottom: 5px; padding-left: 5px; padding-right: 5px; padding-top: 5px;&quot;&gt;Article.order(
  :title.desc,
  :comments =&amp;gt; [:created_at.asc, :updated_at]
).joins(:comments).to_sql
=&amp;gt; SELECT &quot;articles&quot;.* FROM &quot;articles&quot;
   INNER JOIN &quot;comments&quot; ON &quot;comments&quot;.&quot;article_id&quot; = &quot;articles&quot;.&quot;id&quot;
   ORDER BY  &quot;articles&quot;.&quot;title&quot; DESC,
     &quot;comments&quot;.&quot;created_at&quot; ASC, &quot;comments&quot;.&quot;updated_at&quot;&lt;/pre&gt;&lt;h2 style=&quot;border-bottom-width: 0px !important; border-color: initial !important; border-left-width: 0px !important; border-right-width: 0px !important; border-style: initial !important; border-top-color: rgb(224, 224, 224) !important; border-top-style: solid !important; border-top-width: 4px !important; font-size: 20px; margin-bottom: 1em; margin-left: 0px; margin-right: 0px; margin-top: 1.5em !important; padding-bottom: 0px; padding-left: 0px; padding-right: 0px; padding-top: 0.5em !important;&quot;&gt;Polymorphic belongs_to joins&lt;/h2&gt;&lt;div style=&quot;line-height: 1.5em !important; margin-bottom: 1em !important; margin-top: 1em !important; padding-bottom: 0px; padding-left: 0px; padding-right: 0px; padding-top: 0px;&quot;&gt;Polymorphic associations provide great flexibility, but they can sometimes be a bit of a hassle when it comes to querying through a belongs_to association. First, you have to know what type you’re looking for to do a proper join, and then, you’re forced into using a string join in order to make it happen (which would prevent the use of MetaWhere intelligent condition mapping).&lt;/div&gt;&lt;div style=&quot;line-height: 1.5em !important; margin-bottom: 1em !important; margin-top: 1em !important; padding-bottom: 0px; padding-left: 0px; padding-right: 0px; padding-top: 0px;&quot;&gt;MetaWhere allows you to join polymorphic belongs_to associations like this:&lt;/div&gt;&lt;pre style=&quot;-webkit-box-shadow: rgba(0, 0, 0, 0.0664063) 0px 1px 2px inset; background-color: #eeeeee; border-bottom-color: rgb(221, 221, 221); border-bottom-left-radius: 3px 3px; border-bottom-right-radius: 3px 3px; border-bottom-style: solid; border-bottom-width: 1px; border-left-color: rgb(221, 221, 221); border-left-style: solid; border-left-width: 1px; border-right-color: rgb(221, 221, 221); border-right-style: solid; border-right-width: 1px; border-top-color: rgb(221, 221, 221); border-top-left-radius: 3px 3px; border-top-right-radius: 3px 3px; border-top-style: solid; border-top-width: 1px; color: #444444; font-size: 12px; font: normal normal normal 12px/normal &#39;Bitstream Vera Sans Mono&#39;, Courier, monospace; margin-bottom: 1em; margin-top: 1em; overflow-x: auto; overflow-y: auto; padding-bottom: 5px; padding-left: 5px; padding-right: 5px; padding-top: 5px;&quot;&gt;Note.joins(:notable.type(Developer)).
     where(:notable.type(Developer) =&amp;gt; {:name.matches =&amp;gt; &#39;Ernie%&#39;})
=&amp;gt; SELECT &quot;notes&quot;.* FROM &quot;notes&quot;
   INNER JOIN &quot;developers&quot; ON &quot;developers&quot;.&quot;id&quot; = &quot;notes&quot;.&quot;notable_id&quot;
     AND &quot;notes&quot;.&quot;notable_type&quot; = &#39;Developer&#39;
   WHERE &quot;developers&quot;.&quot;name&quot; LIKE &#39;Ernie%&#39;&lt;/pre&gt;&lt;h2 style=&quot;border-bottom-width: 0px !important; border-color: initial !important; border-left-width: 0px !important; border-right-width: 0px !important; border-style: initial !important; border-top-color: rgb(224, 224, 224) !important; border-top-style: solid !important; border-top-width: 4px !important; font-size: 20px; margin-bottom: 1em; margin-left: 0px; margin-right: 0px; margin-top: 1.5em !important; padding-bottom: 0px; padding-left: 0px; padding-right: 0px; padding-top: 0.5em !important;&quot;&gt;Using ActiveRecord objects as condition values&lt;/h2&gt;&lt;div style=&quot;line-height: 1.5em !important; margin-bottom: 1em !important; margin-top: 1em !important; padding-bottom: 0px; padding-left: 0px; padding-right: 0px; padding-top: 0px;&quot;&gt;Wouldn’t it be nice if you could do something like this?&lt;/div&gt;&lt;pre style=&quot;-webkit-box-shadow: rgba(0, 0, 0, 0.0664063) 0px 1px 2px inset; background-color: #eeeeee; border-bottom-color: rgb(221, 221, 221); border-bottom-left-radius: 3px 3px; border-bottom-right-radius: 3px 3px; border-bottom-style: solid; border-bottom-width: 1px; border-left-color: rgb(221, 221, 221); border-left-style: solid; border-left-width: 1px; border-right-color: rgb(221, 221, 221); border-right-style: solid; border-right-width: 1px; border-top-color: rgb(221, 221, 221); border-top-left-radius: 3px 3px; border-top-right-radius: 3px 3px; border-top-style: solid; border-top-width: 1px; color: #444444; font-size: 12px; font: normal normal normal 12px/normal &#39;Bitstream Vera Sans Mono&#39;, Courier, monospace; margin-bottom: 1em; margin-top: 1em; overflow-x: auto; overflow-y: auto; padding-bottom: 5px; padding-left: 5px; padding-right: 5px; padding-top: 5px;&quot;&gt;# Developer belongs_to Company
company = Company.find(123)
Developer.where(:company =&amp;gt; company)

# Developer HABTM Projects
projects = [Project.first, Project.last]
Developer.joins(:projects).where(:projects =&amp;gt; projects)

# Note belongs_to :notable, :polymorphic =&amp;gt; true
dev1 = Developer.first
dev2 = Developer.last
project = Project.first
company = Company.first
Note.where(:notable =&amp;gt; [dev1, dev2, project, company]).to_sql
=&amp;gt; SELECT &quot;notes&quot;.* FROM &quot;notes&quot; WHERE ((((&quot;notes&quot;.&quot;notable_id&quot; IN (1, 8)
   AND &quot;notes&quot;.&quot;notable_type&quot; = &#39;Developer&#39;) OR (&quot;notes&quot;.&quot;notable_id&quot; = 1
   AND &quot;notes&quot;.&quot;notable_type&quot; = &#39;Project&#39;)) OR (&quot;notes&quot;.&quot;notable_id&quot; = 1
   AND &quot;notes&quot;.&quot;notable_type&quot; = &#39;Company&#39;)))&lt;/pre&gt;&lt;div style=&quot;line-height: 1.5em !important; margin-bottom: 1em !important; margin-top: 1em !important; padding-bottom: 0px; padding-left: 0px; padding-right: 0px; padding-top: 0px;&quot;&gt;With MetaWhere, you can.&lt;/div&gt;&lt;h2 style=&quot;border-bottom-width: 0px !important; border-color: initial !important; border-left-width: 0px !important; border-right-width: 0px !important; border-style: initial !important; border-top-color: rgb(224, 224, 224) !important; border-top-style: solid !important; border-top-width: 4px !important; font-size: 20px; margin-bottom: 1em; margin-left: 0px; margin-right: 0px; margin-top: 1.5em !important; padding-bottom: 0px; padding-left: 0px; padding-right: 0px; padding-top: 0.5em !important;&quot;&gt;Thanks&lt;/h2&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://rorashish.blogspot.com/feeds/3603611094048687064/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://rorashish.blogspot.com/2011/09/metawhere-getting-started.html#comment-form' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/2936127337406425108/posts/default/3603611094048687064'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/2936127337406425108/posts/default/3603611094048687064'/><link rel='alternate' type='text/html' href='http://rorashish.blogspot.com/2011/09/metawhere-getting-started.html' title='MetaWhere Getting Started'/><author><name>Anonymous</name><uri>http://www.blogger.com/profile/14643110071701140642</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='16' height='16' src='https://img1.blogblog.com/img/b16-rounded.gif'/></author><thr:total>0</thr:total></entry></feed>