<?xml version="1.0" encoding="UTF-8"?>
<rss version="2.0"
	xmlns:content="http://purl.org/rss/1.0/modules/content/"
	xmlns:wfw="http://wellformedweb.org/CommentAPI/"
	xmlns:dc="http://purl.org/dc/elements/1.1/"
	xmlns:atom="http://www.w3.org/2005/Atom"
	xmlns:sy="http://purl.org/rss/1.0/modules/syndication/"
	xmlns:slash="http://purl.org/rss/1.0/modules/slash/"
	>

<channel>
	<title>Sentia &#124; Sydney IT Consultancy, Software Development, Ruby on Rails, Web Application Development, Rails Development, Test Driven Development, Microsoft.Net, Asp.Net , Agile, Continuous Integration Training, iPhone development &#187; Tutorials</title>
	<atom:link href="http://www.sentia.com.au/category/tutorials/feed/" rel="self" type="application/rss+xml" />
	<link>http://www.sentia.com.au</link>
	<description>Sentia company website and blog about all things development, Ruby on Rails, Microsoft .Net, ASP.Net, C#.Net, Agile web development, Test Driven Development</description>
	<lastBuildDate>Thu, 02 Feb 2012 07:16:46 +0000</lastBuildDate>
	<language>en</language>
	<sy:updatePeriod>hourly</sy:updatePeriod>
	<sy:updateFrequency>1</sy:updateFrequency>
	<generator>http://wordpress.org/?v=3.2.1</generator>
		<item>
		<title>Learning Ruby On Rails</title>
		<link>http://www.sentia.com.au/2010/04/learning-ruby-on-rails/</link>
		<comments>http://www.sentia.com.au/2010/04/learning-ruby-on-rails/#comments</comments>
		<pubDate>Fri, 09 Apr 2010 00:37:02 +0000</pubDate>
		<dc:creator>Michael Cindric</dc:creator>
				<category><![CDATA[development]]></category>
		<category><![CDATA[ruby on rails]]></category>
		<category><![CDATA[Tutorials]]></category>
		<category><![CDATA[learing rails]]></category>

		<guid isPermaLink="false">http://www.sentia.com.au/?p=704</guid>
		<description><![CDATA[Hey spoken to a few developers mainly UNI grads who &#8230; <a href="http://www.sentia.com.au/2010/04/learning-ruby-on-rails/">Continue reading <span class="meta-nav">&#8594;</span></a>]]></description>
			<content:encoded><![CDATA[<p>Hey spoken to a few developers mainly UNI grads who are looking to get into rails and they often ask whats the best way to do so. So l thought l would put together a list of resources they can use to get up to speed.</p>
<p>If anyone else knows of some other ones please let me know</p>
<p>== General Practices ==<br />
Dev on a Mac<br />
Read up on TDD (Test Driven Development)<br />
Use Growl for your Autotest notifications<br />
<a href="http://macromates.com/">TextMate</a> &#8211; The only Editor you need<br />
<a href="http://github.com">GitHub</a> &#8211; Great space to see open source code and gems and plugins<br />
<a href="http://gemcutter.org/">http://gemcutter.org/</a></p>
<p>== Rails Setup ==</p>
<p><a href="http://hivelogic.com/">http://hivelogic.com/</a> &#8211; Has some great tutorials on getting your environment setup on a mac.</p>
<p>== Tutorials ==<br />
<a href="http://rubyonrails.org">http://rubyonrails.org</a><br />
<a href="http://railscasts.com">Rails Casts</a> &#8211; Ryan Bates screen casts about all things rails related<br />
<a href="https://peepcode.com">PeepCode</a> &#8211; Great screen casts about all things rails related</p>
<p>== Blogs ==</p>
<p><a href="http://sentia.com.au/blog">Sentia Blog</a><br />
<a href="http://thoughtbot.com/">http://thoughtbot.com</a><br />
<a href="http://weblog.jamisbuck.org">http://weblog.jamisbuck.org</a><br />
<a href="http://blog.jayfields.com">http://blog.jayfields.com</a><br />
<a href="http://errtheblog.com">http://errtheblog.com</a></p>
<p>== Books ==<br />
<a href="http://pragmaticstudio.com">http://pragmaticstudio.com</a> &#8211; Great source of books about rails and other technologies with a focus on the right practices.</p>
<p>Finally the only real way to learn is to try things out. Follow other developers blogs and use all the resources you can such as Google groups etc.<br />
Don&#8217;t be scared to get it wrong its the only way to learn.</p>
]]></content:encoded>
			<wfw:commentRss>http://www.sentia.com.au/2010/04/learning-ruby-on-rails/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>Because l still forget how to do copyright and trademark symbols in HTML</title>
		<link>http://www.sentia.com.au/2010/02/because-l-still-forget-how-to-do-copyright-and-trademark-symbols-in-html/</link>
		<comments>http://www.sentia.com.au/2010/02/because-l-still-forget-how-to-do-copyright-and-trademark-symbols-in-html/#comments</comments>
		<pubDate>Wed, 24 Feb 2010 23:05:25 +0000</pubDate>
		<dc:creator>Michael Cindric</dc:creator>
				<category><![CDATA[development]]></category>
		<category><![CDATA[html]]></category>
		<category><![CDATA[Tutorials]]></category>
		<category><![CDATA[web standards]]></category>
		<category><![CDATA[html tags]]></category>

		<guid isPermaLink="false">http://sentia.com.au/?p=657</guid>
		<description><![CDATA[Not matter how many times l do it l still &#8230; <a href="http://www.sentia.com.au/2010/02/because-l-still-forget-how-to-do-copyright-and-trademark-symbols-in-html/">Continue reading <span class="meta-nav">&#8594;</span></a>]]></description>
			<content:encoded><![CDATA[<p>Not matter how many times l do it l still never remember how to to the Copyright and Trademark symbols in HTML code so here they are</p>
<p>&copy; can be created with this:</p>
<pre class="brush: xml; title: ; notranslate">
&amp;copy;
</pre>
<p>&reg; can be created with this:</p>
<pre class="brush: xml; title: ; notranslate">
&amp;reg;
</pre>
<p>&trade; can be created with this:</p>
<pre class="brush: xml; title: ; notranslate">
&amp;trade;
</pre>
]]></content:encoded>
			<wfw:commentRss>http://www.sentia.com.au/2010/02/because-l-still-forget-how-to-do-copyright-and-trademark-symbols-in-html/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>PayFlow recurring billing with ActiveMerchant</title>
		<link>http://www.sentia.com.au/2009/10/payflow-recurring-billing-with-activemerchant/</link>
		<comments>http://www.sentia.com.au/2009/10/payflow-recurring-billing-with-activemerchant/#comments</comments>
		<pubDate>Fri, 30 Oct 2009 04:47:47 +0000</pubDate>
		<dc:creator>James Kong</dc:creator>
				<category><![CDATA[development]]></category>
		<category><![CDATA[ruby on rails]]></category>
		<category><![CDATA[Tutorials]]></category>
		<category><![CDATA[activemerchant]]></category>
		<category><![CDATA[Payflow]]></category>
		<category><![CDATA[Payment Gateway]]></category>
		<category><![CDATA[paypal]]></category>
		<category><![CDATA[rails]]></category>
		<category><![CDATA[Recurring Billing]]></category>

		<guid isPermaLink="false">http://sentia.com.au/?p=612</guid>
		<description><![CDATA[Today we are going to look at using ActiveMerchant to &#8230; <a href="http://www.sentia.com.au/2009/10/payflow-recurring-billing-with-activemerchant/">Continue reading <span class="meta-nav">&#8594;</span></a>]]></description>
			<content:encoded><![CDATA[<p>Today we are going to look at using ActiveMerchant to set up a recurring billing subscription with PayFlow .</p>
<p>PayFlow is Paypal&#8217;s payment gateway and you need to setup a PayFlow account.<br />
<strong>IMPORTANT!</strong> This is separate from Paypal&#8217;s development sandbox. Follow these steps to setup a Payflow testing account</p>
<ol>
<li>Go to <a href="https://www.paypal.com/cgi-bin/webscr?cmd=_payflow-get-started-outside">https://www.paypal.com/cgi-bin/webscr?cmd=_payflow-get-started-outside<br />
</a> and fill in the details for an account.</li>
<li>When you get to the page where you need to enter your payment information, hit Save and Exit. This will create a testing PayFlow account for you.</li>
<li>You will be sent an email with your partner ID and your vendor login. Take note of your partner ID as this will be important later.</li>
<li>You should now be able to login at <a href="https://manager.paypal.com/">https://manager.paypal.com/</a></li>
</ol>
<p>Now that you have a PayFlow account, you can use ActiveMerchant to setup payments. For now we will muck around in irb to test that methods out.</p>
<p>So lets open up irb and start by including the active merchant gem and setting ActiveMerchant to test mode</p>
<pre class="brush: ruby; title: ; notranslate">
kongy@Deadpool: $ irb
irb(main):001:0&gt; require 'rubygems'
irb(main):002:0&gt; require 'active_merchant'
irb(main):003:0&gt; ActiveMerchant::Billing::Base.mode = :test
</pre>
<p>Now lets setup the gateway.</p>
<pre class="brush: ruby; title: ; notranslate">
gateway = ActiveMerchant::Billing::PayflowGateway.new(:login =&gt; 'PAYFLOW_LOGIN', :password =&gt; 'PAYFLOW_PASSWORD', :partner =&gt; 'PARTNER_ID')
</pre>
<p>This creates the gateway that we will be using to request purchases. By default ActiveMerchant passes PAYPAL as the partner value if you leave it out. I believe that this is the default for US PayFlow account. For my Aussie one, I received a VSA partner_id. I would suggest putting it in there anyway.</p>
<p>PayFlow Testing only accepts testing credit cards numbers.Ã‚Â  You can grab them from the PayFlow recurring billing documentation found <a href="https://cms.paypal.com/cms_content/US/en_US/files/developer/PayflowPro_RecurringBilling_Guide.pdf">here</a>. Here is a quick list which I can&#8217;t guarantee will be up to date.</p>
<table border="0">
<tbody>
<tr>
<td>American Express</td>
<td>378282246310005</td>
</tr>
<tr>
<td>American Express</td>
<td>371449635398431</td>
</tr>
<tr>
<td>American Express Corporate</td>
<td>378734493671000</td>
</tr>
<tr>
<td>Diners Club</td>
<td>30569309025904</td>
</tr>
<tr>
<td>Diners Club</td>
<td>38520000023237</td>
</tr>
<tr>
<td>Discover</td>
<td>6011111111111117</td>
</tr>
<tr>
<td>Discover</td>
<td>6011000990139424</td>
</tr>
<tr>
<td>JCB</td>
<td>3530111333300000</td>
</tr>
<tr>
<td>JCB</td>
<td>3566002020360505</td>
</tr>
<tr>
<td>MasterCard</td>
<td>5555555555554444</td>
</tr>
<tr>
<td>MasterCard</td>
<td>5105105105105100</td>
</tr>
<tr>
<td>Visa</td>
<td>4111111111111111</td>
</tr>
<tr>
<td>Visa</td>
<td>4012888888881881</td>
</tr>
<tr>
<td>Visa</td>
<td>4222222222222</td>
</tr>
</tbody>
</table>
<p>So lets create a Mastercard credit card.</p>
<pre class="brush: ruby; title: ; notranslate">
irb(main):004:0&gt; credit_card = ActiveMerchant::Billing::CreditCard.new( :number =&gt; '5105105105105100', :month =&gt; '9', :year =&gt; '2007', :first_name =&gt; 'Mal', :last_name =&gt; 'Reynolds', :verification_value =&gt; '123', :type =&gt; 'master' )
</pre>
<p>Now we are ready to start billing. If you want to setup a one time payment it is quite easy.</p>
<pre class="brush: ruby; title: ; notranslate">
irb(main):007:0&gt; response = gateway.purchase(1000, credit_card)
irb(main):008:0&gt; response.success?
=&gt; true
</pre>
<p>If you go into your Paypal Manager and search for transactions you should see it appear.</p>
<p>To setup a recurring billing we need to use the <b>recurring</b> method of the gateway. The recurring method accepts the amount in cents, the credit card object and the time intervals to charge the card, at a minimum. There are other options available which you can find <a href="http://activemerchant.rubyforge.org/classes/ActiveMerchant/Billing/PayflowGateway.html">here</a>. Lets charge $10/month</p>
<pre class="brush: ruby; title: ; notranslate">
irb(main):009:0&gt; response = gateway.recurring(100, credit_card, :periodicity =&gt; :monthly)
irb(main):010:0&gt; response.success?
=&gt; true
irb(main):011:0&gt; response.profile_id
=&gt; &quot;RT0000000002&quot;
</pre>
<p>You can view the recurring billings in your Paypal Manager by clicking on Service Settings > Recurring Billings > Manage Profiles. You will probably want to store the profile_id in your database for when you need to edit details of the recurring billing. You can do it quite simply by calling the <b>recurring</b> method again. Let&#8217;s change the amount we want to bill to $20/week.</p>
<pre class="brush: ruby; title: ; notranslate">
irb(main):0012:0&gt; response = gateway.recurring(2000, nil, :profile_id =&gt; &quot;RT0000000001&quot;,  :periodicity =&gt; :weekly)
irb(main):013:0&gt; response.success?
=&gt; true
</pre>
<p>You can see here that we no longer need to pass in the credit card since we have the profile_id. We update the amount, and change the periodicity of the billing.</p>
<p>And that&#8217;s it.</p>
]]></content:encoded>
			<wfw:commentRss>http://www.sentia.com.au/2009/10/payflow-recurring-billing-with-activemerchant/feed/</wfw:commentRss>
		<slash:comments>1</slash:comments>
		</item>
		<item>
		<title>When to use Nested Controllers in your Rails apps</title>
		<link>http://www.sentia.com.au/2009/09/when-to-use-nested-controllers-in-your-rails-apps/</link>
		<comments>http://www.sentia.com.au/2009/09/when-to-use-nested-controllers-in-your-rails-apps/#comments</comments>
		<pubDate>Tue, 29 Sep 2009 00:27:43 +0000</pubDate>
		<dc:creator>Michael Cindric</dc:creator>
				<category><![CDATA[development]]></category>
		<category><![CDATA[ruby on rails]]></category>
		<category><![CDATA[Tutorials]]></category>
		<category><![CDATA[nested controllers]]></category>
		<category><![CDATA[rails]]></category>

		<guid isPermaLink="false">http://sentia.com.au/?p=575</guid>
		<description><![CDATA[Nested controllers are great. I don&#8217;t care that they have &#8230; <a href="http://www.sentia.com.au/2009/09/when-to-use-nested-controllers-in-your-rails-apps/">Continue reading <span class="meta-nav">&#8594;</span></a>]]></description>
			<content:encoded><![CDATA[<p>Nested controllers are great. I don&#8217;t care that they have a stigma attached to them they work well and make sense especially if your rails application has a Admin section for example. This allows you to easy separate the admin logic into its own controllers etc keeping your code clean and easy to manage.</p>
<p>So thats what we are going to do for this example.</p>
<h2>Step 1.  Create your admin controller</h2>
<p>You can use whichever process works best for you, but for this we are going to use script/generate:</p>
<pre class="brush: ruby; title: ; notranslate">
 ./script/generate controller admin
</pre>
<h2>Step 2.  Create your user controller</h2>
<p>You can use whichever process works best for you, but for this we are going to use script/generate:</p>
<pre class="brush: ruby; title: ; notranslate">
 ./script/generate controller admin/users
</pre>
<h2>Step 3.  Check to ensure proper inheritance</h2>
<p>The nested users controller should look something like so:</p>
<pre class="brush: ruby; title: ; notranslate">
class Admin::UsersController &lt; ApplicationController
end
</pre>
<h2>Step 4. Create the Routes</h2>
<p>The nested users controller should look something like so:</p>
<pre class="brush: ruby; title: ; notranslate">
map.namespace :admin do |admin|
  admin.resources :users
end
</pre>
<p>Before rails 2+ you had to do like like we have below. Personally l don&#8217;t mind it makes it a little easier to read but either option works fine</p>
<pre class="brush: ruby; title: ; notranslate">
map.resource(:admin) do |admin|
  admin.resources(:users, :controller =&gt; 'admin/users')
end
</pre>
<h2>Step 5. Wait there is no step 5 your done</h2>
<p>Now when you need to link to any of these actions its very simple keeping in mind that users is nested under the admin controller so all you have to do to create a link that goes to the index action on the nested users controller is add the admin prefix before</p>
<pre class="brush: ruby; title: ; notranslate">
 link_to &quot;Users&quot;, admin_users_url
</pre>
<p>The same applies when you are wanting to link to the show action of users all you do is loose the &#8220;s&#8221; on users as you would normally</p>
<pre class="brush: ruby; title: ; notranslate">
 link_to &quot;View User&quot;, admin_user_url(@user)
</pre>
<p>You can see a list of all the routes you have available to you by going to the root directory of your project in terminal and typing</p>
<pre class="brush: ruby; title: ; notranslate">
rake routes
</pre>
]]></content:encoded>
			<wfw:commentRss>http://www.sentia.com.au/2009/09/when-to-use-nested-controllers-in-your-rails-apps/feed/</wfw:commentRss>
		<slash:comments>2</slash:comments>
		</item>
	</channel>
</rss>

