<?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-5239772036970821739</id><updated>2024-10-24T05:16:22.217-07:00</updated><title type='text'>Play With Ruby On Rails</title><subtitle type='html'></subtitle><link rel='http://schemas.google.com/g/2005#feed' type='application/atom+xml' href='http://playwithrubyandrails.blogspot.com/feeds/posts/default'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/5239772036970821739/posts/default?redirect=false'/><link rel='alternate' type='text/html' href='http://playwithrubyandrails.blogspot.com/'/><link rel='hub' href='http://pubsubhubbub.appspot.com/'/><author><name>Unknown</name><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>7</openSearch:totalResults><openSearch:startIndex>1</openSearch:startIndex><openSearch:itemsPerPage>25</openSearch:itemsPerPage><entry><id>tag:blogger.com,1999:blog-5239772036970821739.post-6451922470562056242</id><published>2011-06-16T00:25:00.000-07:00</published><updated>2011-06-16T00:25:14.709-07:00</updated><title type='text'>Identify user&#39;s location [ Region/Sub Region ] based on IP address</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: Arial,Helvetica,sans-serif;&quot;&gt;&lt;span style=&quot;font-size: small;&quot;&gt;&lt;span class=&quot;Apple-style-span&quot; style=&quot;border-collapse: separate; color: black; font-style: normal; font-variant: normal; font-weight: normal; letter-spacing: normal; line-height: normal; orphans: 2; text-indent: 0px; text-transform: none; white-space: normal; widows: 2; word-spacing: 0px;&quot;&gt;&lt;span class=&quot;Apple-style-span&quot; style=&quot;color: #333333;&quot;&gt;There are some gems/plugins available&lt;br /&gt;
1. Geokit&amp;nbsp;&lt;a href=&quot;https://github.com/jlecour/geokit-rails3&quot; style=&quot;color: #0000cc;&quot; target=&quot;_blank&quot;&gt;https://github.com/&lt;wbr&gt;&lt;/wbr&gt;jlecour/geokit-rails3&lt;/a&gt;&lt;br /&gt;
2. Geoip&amp;nbsp;&lt;a href=&quot;https://github.com/mtodd/geoip&quot; style=&quot;color: #0000cc;&quot; target=&quot;_blank&quot;&gt;https://github.com/&lt;wbr&gt;&lt;/wbr&gt;mtodd/geoip&lt;/a&gt;&lt;br /&gt;
3. Geomagic&amp;nbsp;&lt;a href=&quot;https://github.com/kristianmandrup/geo_magic&quot; style=&quot;color: #0000cc;&quot; target=&quot;_blank&quot;&gt;https://github.com/&lt;wbr&gt;&lt;/wbr&gt;kristianmandrup/geo_magic&lt;/a&gt;&lt;br /&gt;
4. Geo Location&amp;nbsp;&lt;a href=&quot;https://github.com/chrisyour/geo_location&quot; style=&quot;color: #0000cc;&quot; target=&quot;_blank&quot;&gt;https://github.com/&lt;wbr&gt;&lt;/wbr&gt;chrisyour/geo_location&lt;/a&gt;&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;/div&gt;&lt;div style=&quot;font-family: Arial,Helvetica,sans-serif;&quot;&gt;&lt;span style=&quot;font-size: small;&quot;&gt;&lt;span class=&quot;Apple-style-span&quot; style=&quot;border-collapse: separate; color: black; font-style: normal; font-variant: normal; font-weight: normal; letter-spacing: normal; line-height: normal; orphans: 2; text-indent: 0px; text-transform: none; white-space: normal; widows: 2; word-spacing: 0px;&quot;&gt;&lt;span class=&quot;Apple-style-span&quot; style=&quot;color: #333333;&quot;&gt;&amp;nbsp;&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;span style=&quot;font-size: small;&quot;&gt;Your current best bet is probably GeoKit (&lt;a href=&quot;http://github.com/andre/geokit-gem&quot; rel=&quot;nofollow&quot;&gt;http://github.com/andre/geokit-gem&lt;/a&gt; for gem, &lt;a href=&quot;http://github.com/andre/geokit-rails&quot; rel=&quot;nofollow&quot;&gt;http://github.com/andre/geokit-rails&lt;/a&gt;  for plugin). It has built in functionality for Yahoo and Google API  keys, distance calculation helpers, reverse geolocation, etc.&amp;nbsp; &lt;span class=&quot;Apple-style-span&quot; style=&quot;border-collapse: separate; color: black; font-style: normal; font-variant: normal; font-weight: normal; letter-spacing: normal; line-height: normal; orphans: 2; text-indent: 0px; text-transform: none; white-space: normal; widows: 2; word-spacing: 0px;&quot;&gt;&lt;span class=&quot;Apple-style-span&quot; style=&quot;color: #333333;&quot;&gt;Also Can find basic information of an IP like&amp;nbsp;street_address,&amp;nbsp;city,&amp;nbsp;&lt;wbr&gt;&lt;/wbr&gt;state,&amp;nbsp;&amp;nbsp;zip&amp;nbsp;etc. (As needed)&lt;br /&gt;
Please find details here&amp;nbsp;&lt;a href=&quot;http://geokit.rubyforge.org/api/geokit-gem/Geokit/GeoLoc.html&quot; style=&quot;color: #0000cc;&quot; target=&quot;_blank&quot;&gt;http://geokit.rubyforge.&lt;wbr&gt;&lt;/wbr&gt;org/api/geokit-gem/Geokit/&lt;wbr&gt;&lt;/wbr&gt;GeoLoc.html&lt;/a&gt;&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;/div&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://playwithrubyandrails.blogspot.com/feeds/6451922470562056242/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://playwithrubyandrails.blogspot.com/2011/06/identify-users-location-regionsub.html#comment-form' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/5239772036970821739/posts/default/6451922470562056242'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/5239772036970821739/posts/default/6451922470562056242'/><link rel='alternate' type='text/html' href='http://playwithrubyandrails.blogspot.com/2011/06/identify-users-location-regionsub.html' title='Identify user&#39;s location [ Region/Sub Region ] based on IP address'/><author><name>Unknown</name><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-5239772036970821739.post-79233065789602429</id><published>2011-04-29T08:27:00.000-07:00</published><updated>2011-04-29T08:28:19.495-07:00</updated><title type='text'>Steps to vendor rails Or upgrade vendor rails in an application</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-size: small;&quot;&gt;Step 1 # Install Rails required version ( say 2.3.10 ) ( for ubuntu &lt;b style=&quot;color: #006600;&quot;&gt;gem install rails -v = 2.3.10&lt;/b&gt; )&lt;/span&gt;&lt;br /&gt;
&lt;span style=&quot;font-size: small;&quot;&gt;&lt;br /&gt;
&lt;/span&gt; &lt;span style=&quot;font-size: small;&quot;&gt;Step 2 # To ‘freeze’ your rails gems, simply type the following in your terminal window: &lt;b style=&quot;color: #006600;&quot;&gt;rake rails:freeze:gems&lt;/b&gt;&amp;nbsp;&lt;/span&gt;&lt;br /&gt;
&lt;span style=&quot;font-size: small;&quot;&gt;This will create a new folder in &lt;i&gt;/vendor/&lt;/i&gt; called ‘rails’ and unpack all of the core Rails gems. &lt;/span&gt;&lt;br /&gt;
&lt;span style=&quot;font-size: small;&quot;&gt;&lt;br /&gt;
Step 3 # Instead of having to install the required gems wherever  your app goes, your app can pack the gems up and take them with it .&lt;/span&gt;&lt;br /&gt;
&lt;span style=&quot;font-size: small;&quot;&gt;To unpack the required gems simply &lt;b style=&quot;color: #006600;&quot;&gt;run rake gems:unpack:dependencies&lt;/b&gt;&amp;nbsp;&lt;/span&gt;&lt;br /&gt;
&lt;span style=&quot;font-size: small;&quot;&gt;This will unpack all of the gems required in your &lt;b&gt;environment.rb&lt;/b&gt; file plus any gems they may require into &lt;i&gt;vendor/gems/&lt;/i&gt;&lt;/span&gt;&lt;br /&gt;
&lt;span style=&quot;font-size: small;&quot;&gt;&lt;i&gt;&amp;nbsp;&lt;/i&gt;&lt;br /&gt;
&lt;/span&gt;&lt;br /&gt;
&lt;span style=&quot;font-size: small;&quot;&gt;Step 4 # Now you can uninstall rails ( for ubuntu &lt;b style=&quot;color: #006600;&quot;&gt;gem uninstall rails&lt;/b&gt; ) . And Your app will have use rails with version 2.3.10&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;span style=&quot;color: #cc0000;&quot;&gt;If you decide to unfreeze Rails and revert back to the system installed version instead, simply run&lt;/span&gt;&lt;/span&gt; &lt;span style=&quot;font-size: small;&quot;&gt;&lt;br style=&quot;color: #cc0000;&quot; /&gt;&lt;b style=&quot;color: #cc0000;&quot;&gt;rake rails:unfreeze&lt;/b&gt;&lt;br style=&quot;color: #cc0000;&quot; /&gt;&lt;span style=&quot;color: #cc0000;&quot;&gt;This will remove the &lt;/span&gt;&lt;i style=&quot;color: #cc0000;&quot;&gt;rails&lt;/i&gt;&lt;span style=&quot;color: #cc0000;&quot;&gt; directory from &lt;/span&gt;&lt;i style=&quot;color: #cc0000;&quot;&gt;/vendor/&lt;/i&gt;&lt;span style=&quot;color: #cc0000;&quot;&gt; and all of its contents.&lt;/span&gt;&lt;/span&gt; &lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://playwithrubyandrails.blogspot.com/feeds/79233065789602429/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://playwithrubyandrails.blogspot.com/2011/04/steps-to-vendor-rails-or-upgrade-vendor.html#comment-form' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/5239772036970821739/posts/default/79233065789602429'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/5239772036970821739/posts/default/79233065789602429'/><link rel='alternate' type='text/html' href='http://playwithrubyandrails.blogspot.com/2011/04/steps-to-vendor-rails-or-upgrade-vendor.html' title='Steps to vendor rails Or upgrade vendor rails in an application'/><author><name>Unknown</name><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-5239772036970821739.post-7454551976311727316</id><published>2011-04-25T23:19:00.000-07:00</published><updated>2011-04-25T23:20:28.692-07:00</updated><title type='text'>error for ActionController::InvalidAuthenticityToken (ActionController</title><content type='html'>&lt;div dir=&quot;ltr&quot; style=&quot;text-align: left;&quot; trbidi=&quot;on&quot;&gt;&lt;pre style=&quot;font-family: Arial,Helvetica,sans-serif;&quot;&gt;&lt;span style=&quot;font-size: x-small;&quot;&gt;&lt;span style=&quot;font-size: small;&quot;&gt;Set this in your controller class definition&lt;/span&gt;&amp;nbsp;&lt;/span&gt;&lt;/pre&gt;&lt;pre style=&quot;font-family: Arial,Helvetica,sans-serif;&quot;&gt;&lt;span style=&quot;font-size: x-small;&quot;&gt;                          &lt;b&gt;protect_from_forgery :only =&amp;gt; [:create, :update, :destroy]&lt;/b&gt;&lt;/span&gt;&lt;/pre&gt;&lt;span style=&quot;font-size: small;&quot;&gt;&lt;span style=&quot;font-family: Arial,Helvetica,sans-serif;&quot;&gt;or add this in current form&lt;/span&gt;&lt;/span&gt;&lt;br /&gt;
&lt;pre style=&quot;font-family: Arial,Helvetica,sans-serif;&quot;&gt;&lt;span style=&quot;font-size: x-small;&quot;&gt;                       &lt;b&gt;&amp;lt;%=&lt;/b&gt;&lt;b&gt; hidden_field_tag :authenticity_token, form_authenticity_token -%&amp;gt;&lt;/b&gt;&lt;/span&gt;&lt;/pre&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://playwithrubyandrails.blogspot.com/feeds/7454551976311727316/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://playwithrubyandrails.blogspot.com/2011/04/error-for-actioncontrollerinvalidauthen.html#comment-form' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/5239772036970821739/posts/default/7454551976311727316'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/5239772036970821739/posts/default/7454551976311727316'/><link rel='alternate' type='text/html' href='http://playwithrubyandrails.blogspot.com/2011/04/error-for-actioncontrollerinvalidauthen.html' title='error for ActionController::InvalidAuthenticityToken (ActionController'/><author><name>Unknown</name><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-5239772036970821739.post-1703760158231615593</id><published>2011-04-25T23:16:00.001-07:00</published><updated>2011-04-25T23:16:38.448-07:00</updated><title type='text'>Remove Displaying SQL queries on Prompt</title><content type='html'>&lt;div dir=&quot;ltr&quot; style=&quot;text-align: left;&quot; trbidi=&quot;on&quot;&gt;&lt;pre&gt;&lt;span style=&quot;font-family: arial narrow,sans-serif; font-size: x-small;&quot;&gt;Add this line in enviornment/development.rb will not show sql info(queries) on terminal
&lt;b&gt;config.log_level = :info&lt;/b&gt;&lt;/span&gt;&lt;/pre&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://playwithrubyandrails.blogspot.com/feeds/1703760158231615593/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://playwithrubyandrails.blogspot.com/2011/04/remove-displaying-sql-queries-on-prompt.html#comment-form' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/5239772036970821739/posts/default/1703760158231615593'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/5239772036970821739/posts/default/1703760158231615593'/><link rel='alternate' type='text/html' href='http://playwithrubyandrails.blogspot.com/2011/04/remove-displaying-sql-queries-on-prompt.html' title='Remove Displaying SQL queries on Prompt'/><author><name>Unknown</name><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-5239772036970821739.post-4017710299597651885</id><published>2011-04-23T01:10:00.000-07:00</published><updated>2011-04-23T04:38:51.746-07:00</updated><title type='text'>Process for deploying app on heroku :-</title><content type='html'>&lt;div dir=&quot;ltr&quot; style=&quot;text-align: left;&quot; trbidi=&quot;on&quot;&gt;1) sudo gem install heroku&lt;br /&gt;
2) heroku create app_name&lt;br /&gt;
3) git init&lt;br /&gt;
4) git add ( add the files present in the app, see the files by &lt;b&gt;ls &lt;/b&gt;command)&lt;br /&gt;
5) git commit -m &quot;commit the app&quot;&lt;br /&gt;
6) cd ~/.ssh (see that ssh directory exists or not)&lt;br /&gt;
&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; if exists then&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; &lt;br /&gt;
&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; $ ls&lt;br /&gt;
&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; $ config                id_rsa.pub&lt;br /&gt;
&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; $ id_rsa                known_hosts&lt;br /&gt;
&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; $ mkdir key_backup&lt;br /&gt;
&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; $ cp id_rsa* key_backup&lt;br /&gt;
&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; $ rm id_rsa*-- &lt;br /&gt;
&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; if &quot;not exists&quot; then &lt;br /&gt;
&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; $ ssh-keygen -t rsa -C &quot;your email&quot;&lt;br /&gt;
8) heroku create&lt;br /&gt;
9) heroku keys:add&lt;br /&gt;
10) git push heroku master&lt;br /&gt;
11) heroku rake db:migrate.&lt;br /&gt;
&lt;br /&gt;
To see the error in opening the site in the browser &lt;br /&gt;
&amp;nbsp; heroku logs --app app_name ( run that command on the terminal)&lt;br /&gt;
&lt;br /&gt;
if git push heroku master gives following error&lt;br /&gt;
&lt;br /&gt;
------Agent admitted failure to sign using the key.&lt;br /&gt;
Permission denied (publickey).&lt;br /&gt;
fatal: The remote end hung up unexpectedly&lt;br /&gt;
&lt;br /&gt;
then run this on prompt&lt;br /&gt;
&lt;br /&gt;
&lt;b&gt;ssh-add ~/.ssh/id_rsa&lt;/b&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://playwithrubyandrails.blogspot.com/feeds/4017710299597651885/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://playwithrubyandrails.blogspot.com/2011/04/process-for-deploying-app-on-heroku.html#comment-form' title='2 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/5239772036970821739/posts/default/4017710299597651885'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/5239772036970821739/posts/default/4017710299597651885'/><link rel='alternate' type='text/html' href='http://playwithrubyandrails.blogspot.com/2011/04/process-for-deploying-app-on-heroku.html' title='Process for deploying app on heroku :-'/><author><name>Unknown</name><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-5239772036970821739.post-3248736262714293659</id><published>2011-04-23T01:06:00.000-07:00</published><updated>2011-04-23T01:06:13.781-07:00</updated><title type='text'>Using ActiveScaffold with Rails 3.0</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;b&gt;Setup Rails 3 project&lt;/b&gt; :&lt;br /&gt;
&lt;ol&gt;&lt;li&gt;rails new howto&lt;/li&gt;
&lt;li&gt;cd howto&lt;/li&gt;
&lt;li&gt;bundle install&lt;/li&gt;
&lt;li&gt;rake db:create&lt;/li&gt;
&lt;/ol&gt;&lt;b&gt;Setup ActiveScaffol&lt;/b&gt;d (you will need a running git bash):&lt;br /&gt;
&lt;ol&gt;&lt;li&gt;rails plugin install git://&lt;a href=&quot;http://github.com/vhochstein/active_scaffold.git&quot; target=&quot;_blank&quot;&gt;github.com/vhochstein/&lt;wbr&gt;&lt;/wbr&gt;active_scaffold.git&lt;/a&gt;&lt;/li&gt;
&lt;li&gt;rails g active_scaffold_setup [prototype| jquery]&lt;/li&gt;
&lt;/ol&gt;Your choice if you would like to use prototype or jquery. Thanks to  Rails 3.0 and the new unobtrusive Javascript approach. If you are asked  if you would like to overwrite rails.js just say yes.&lt;br /&gt;
&lt;b&gt;Setup two activescaffolds&lt;/b&gt;:&lt;br /&gt;
&lt;ol&gt;&lt;li&gt;rails g active_scaffold Team name:string position:integer&lt;/li&gt;
&lt;li&gt;rails g active_scaffold Player name:string injured:boolean salary:decimal date_of_birth:date&amp;nbsp; team:references&lt;/li&gt;
&lt;li&gt;rake db:migrate&lt;/li&gt;
&lt;li&gt;edit file app/models/team.rb -&amp;gt; has_many :players&lt;/li&gt;
&lt;li&gt;&lt;span style=&quot;font-family: &#39;arial narrow&#39;, sans-serif; font-size: x-small;&quot;&gt;edit file /app/views/layouts/&lt;wbr&gt;&lt;/wbr&gt;application.html.erb-&amp;gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; &lt;/span&gt;&lt;pre&gt;&lt;span style=&quot;font-family: &#39;Helvetica Neue&#39;, Arial, Helvetica, sans-serif; font-size: medium;&quot;&gt;&lt;code&gt;&amp;lt;%= javascript_include_tag :defaults %&amp;gt;
&amp;lt;%= active_scaffold_includes %&amp;gt;&lt;/code&gt;&lt;/span&gt;&lt;/pre&gt;&lt;/li&gt;
&lt;li&gt;&lt;pre&gt;&lt;code&gt;&lt;span style=&quot;font-family: arial, helvetica, sans-serif; font-size: x-small;&quot;&gt;Add&lt;/span&gt;&lt;span style=&quot;font-family: &#39;arial narrow&#39;, sans-serif; font-size: x-small;&quot;&gt; this to ur controller&lt;/span&gt;     &lt;b&gt;&lt;span style=&quot;font-family: &#39;arial narrow&#39;, sans-serif; font-size: x-small;&quot;&gt;active_scaffold :&amp;lt;your_model_name&amp;gt;&lt;/span&gt;&lt;/b&gt;&lt;/code&gt;&lt;/pre&gt;&lt;/li&gt;
&lt;li&gt;Add :active_scaffold =&amp;gt; true to your routes: by writing his in /config/routes.rb&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; &lt;br /&gt;
&lt;pre style=&quot;font-family: verdana,sans-serif;&quot;&gt;&lt;span style=&quot;font-size: medium;&quot;&gt;&lt;b&gt;&lt;code&gt;map.resources :users, :active_scaffold :user&lt;/code&gt;&lt;/b&gt;&lt;/span&gt;&lt;/pre&gt;&lt;/li&gt;
&lt;li&gt;rails s&lt;/li&gt;
&lt;li&gt;Open Browser: &lt;a href=&quot;http://localhost:3000/teams&quot; target=&quot;_blank&quot;&gt;http://localhost:3000/teams&lt;/a&gt;&lt;/li&gt;
&lt;/ol&gt;That ‘s it. You ve got a running application to CRUD teams and players using Rails 3 and ActiveScaffold.&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://playwithrubyandrails.blogspot.com/feeds/3248736262714293659/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://playwithrubyandrails.blogspot.com/2011/04/using-activescaffold-with-rails-30.html#comment-form' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/5239772036970821739/posts/default/3248736262714293659'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/5239772036970821739/posts/default/3248736262714293659'/><link rel='alternate' type='text/html' href='http://playwithrubyandrails.blogspot.com/2011/04/using-activescaffold-with-rails-30.html' title='Using ActiveScaffold with Rails 3.0'/><author><name>Unknown</name><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-5239772036970821739.post-6134005537485770406</id><published>2011-04-23T01:03:00.000-07:00</published><updated>2011-04-23T01:03:33.334-07:00</updated><title type='text'>Singular Plural In Rails</title><content type='html'>&lt;div dir=&quot;ltr&quot; style=&quot;text-align: left;&quot; trbidi=&quot;on&quot;&gt;Keep Following things in mind : -&lt;br /&gt;
1) The &lt;b&gt;database table&lt;/b&gt; is &lt;b&gt;plural&lt;/b&gt;.&lt;br /&gt;
2) The &lt;b&gt;model&lt;/b&gt; is &lt;b&gt;singular&lt;/b&gt;, and associations are pluralization sensitive&lt;br /&gt;
3)&amp;nbsp;resource-based &lt;b&gt;controllers&lt;/b&gt; should be &lt;b&gt;plural&lt;/b&gt; (which means the directory for the &lt;b&gt;views&lt;/b&gt; and the &lt;b&gt;helper&lt;/b&gt; is also &lt;b&gt;plural&lt;/b&gt;).&lt;br /&gt;
4) The &lt;b&gt;route&lt;/b&gt; name and the &lt;b&gt;urls&lt;/b&gt; it generates/recognizes are &lt;b&gt;plural&lt;/b&gt;.&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://playwithrubyandrails.blogspot.com/feeds/6134005537485770406/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://playwithrubyandrails.blogspot.com/2011/04/singular-plural-in-rails.html#comment-form' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/5239772036970821739/posts/default/6134005537485770406'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/5239772036970821739/posts/default/6134005537485770406'/><link rel='alternate' type='text/html' href='http://playwithrubyandrails.blogspot.com/2011/04/singular-plural-in-rails.html' title='Singular Plural In Rails'/><author><name>Unknown</name><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>