<?xml version="1.0" encoding="utf-8"?>
<!-- generator="FeedCreator 1.7.2-ppt DokuWiki" -->
<?xml-stylesheet href="https://tech.solin.eu/lib/exe/css.php?s=feed" type="text/css"?>
<rdf:RDF
    xmlns="http://purl.org/rss/1.0/"
    xmlns:rdf="http://www.w3.org/1999/02/22-rdf-syntax-ns#"
    xmlns:slash="http://purl.org/rss/1.0/modules/slash/"
    xmlns:dc="http://purl.org/dc/elements/1.1/">
    <channel rdf:about="https://tech.solin.eu/feed.php">
        <title>Solin Expertise Center ror</title>
        <description></description>
        <link>https://tech.solin.eu/</link>
        <image rdf:resource="https://tech.solin.eu/lib/tpl/monobook/images/favicon.ico" />
       <dc:date>2026-04-16T04:11:34+00:00</dc:date>
        <items>
            <rdf:Seq>
                <rdf:li rdf:resource="https://tech.solin.eu/doku.php?id=ror:activemerchant&amp;rev=1285746963&amp;do=diff"/>
                <rdf:li rdf:resource="https://tech.solin.eu/doku.php?id=ror:activerecord&amp;rev=1243943184&amp;do=diff"/>
                <rdf:li rdf:resource="https://tech.solin.eu/doku.php?id=ror:auto_complete&amp;rev=1256329022&amp;do=diff"/>
                <rdf:li rdf:resource="https://tech.solin.eu/doku.php?id=ror:caching&amp;rev=1258148134&amp;do=diff"/>
                <rdf:li rdf:resource="https://tech.solin.eu/doku.php?id=ror:caching_and_localization&amp;rev=1314192933&amp;do=diff"/>
                <rdf:li rdf:resource="https://tech.solin.eu/doku.php?id=ror:caching_nested_forms&amp;rev=1258406000&amp;do=diff"/>
                <rdf:li rdf:resource="https://tech.solin.eu/doku.php?id=ror:class_instance_variable_vs_class_variables&amp;rev=1222085177&amp;do=diff"/>
                <rdf:li rdf:resource="https://tech.solin.eu/doku.php?id=ror:code_samples&amp;rev=1238936852&amp;do=diff"/>
                <rdf:li rdf:resource="https://tech.solin.eu/doku.php?id=ror:error_handling_and_validation&amp;rev=1278946988&amp;do=diff"/>
                <rdf:li rdf:resource="https://tech.solin.eu/doku.php?id=ror:how_to_enable_caching&amp;rev=1258147889&amp;do=diff"/>
                <rdf:li rdf:resource="https://tech.solin.eu/doku.php?id=ror:how_to_prevent_asset_caching&amp;rev=1314192933&amp;do=diff"/>
                <rdf:li rdf:resource="https://tech.solin.eu/doku.php?id=ror:installing_and_configuring&amp;rev=1229802959&amp;do=diff"/>
                <rdf:li rdf:resource="https://tech.solin.eu/doku.php?id=ror:making_code_blocks_with_ampersand&amp;rev=1224074074&amp;do=diff"/>
                <rdf:li rdf:resource="https://tech.solin.eu/doku.php?id=ror:operators_precedence_table&amp;rev=1314192933&amp;do=diff"/>
                <rdf:li rdf:resource="https://tech.solin.eu/doku.php?id=ror:plugins&amp;rev=1314192933&amp;do=diff"/>
                <rdf:li rdf:resource="https://tech.solin.eu/doku.php?id=ror:rails_related_issues&amp;rev=1449583177&amp;do=diff"/>
                <rdf:li rdf:resource="https://tech.solin.eu/doku.php?id=ror:ruby&amp;rev=1243662741&amp;do=diff"/>
                <rdf:li rdf:resource="https://tech.solin.eu/doku.php?id=ror:ruby_on_rails&amp;rev=1256328218&amp;do=diff"/>
                <rdf:li rdf:resource="https://tech.solin.eu/doku.php?id=ror:sorting_an_array_by_multiple_properties_or_objects&amp;rev=1243662970&amp;do=diff"/>
                <rdf:li rdf:resource="https://tech.solin.eu/doku.php?id=ror:test_driven_development&amp;rev=1254341847&amp;do=diff"/>
                <rdf:li rdf:resource="https://tech.solin.eu/doku.php?id=ror:the_basics&amp;rev=1223643852&amp;do=diff"/>
                <rdf:li rdf:resource="https://tech.solin.eu/doku.php?id=ror:validation&amp;rev=1221558807&amp;do=diff"/>
            </rdf:Seq>
        </items>
    </channel>
    <image rdf:about="https://tech.solin.eu/lib/tpl/monobook/images/favicon.ico">
        <title>Solin Expertise Center</title>
        <link>https://tech.solin.eu/</link>
        <url>https://tech.solin.eu/lib/tpl/monobook/images/favicon.ico</url>
    </image>
    <item rdf:about="https://tech.solin.eu/doku.php?id=ror:activemerchant&amp;rev=1285746963&amp;do=diff">
        <dc:format>text/html</dc:format>
        <dc:date>2010-09-29T07:56:03+00:00</dc:date>
        <title>ror:activemerchant</title>
        <link>https://tech.solin.eu/doku.php?id=ror:activemerchant&amp;rev=1285746963&amp;do=diff</link>
        <description>ActiveMerchant is a plugin that interfaces with payment gateways. I'm using it to connect to paypal.com, so all information presented here is based on that premise. It's easy to use, but there are a few details to be aware of.

Sources:

	*  ActiveMerchant API
	*  Paypal IPN variables
	*  Using Paypal with Rails
	*  Paypal IPN in Rails with Active Merchant</description>
    </item>
    <item rdf:about="https://tech.solin.eu/doku.php?id=ror:activerecord&amp;rev=1243943184&amp;do=diff">
        <dc:format>text/html</dc:format>
        <dc:date>2009-06-02T11:46:24+00:00</dc:date>
        <title>ror:activerecord</title>
        <link>https://tech.solin.eu/doku.php?id=ror:activerecord&amp;rev=1243943184&amp;do=diff</link>
        <description>Nested :include vs. Home Made Joins

(Using Rails 1.1.6 and Ruby ruby 1.8.5 (2006-08-25) [i486-linux])

To avoid multiple database queries, you can use the :include. Here's an example:


    @saved_games = SavedGame.find(
          :all,
          :include =&gt; [:account]
        )</description>
    </item>
    <item rdf:about="https://tech.solin.eu/doku.php?id=ror:auto_complete&amp;rev=1256329022&amp;do=diff">
        <dc:format>text/html</dc:format>
        <dc:date>2009-10-23T20:17:02+00:00</dc:date>
        <title>ror:auto_complete</title>
        <link>https://tech.solin.eu/doku.php?id=ror:auto_complete&amp;rev=1256329022&amp;do=diff</link>
        <description>The auto_complete plugin provides “live”, ajax based autocompletion for text input fields. Installation:


script/plugin install auto_complete


Usage (taken from README file in plugin):


  # Controller
  class BlogController &lt; ApplicationController
    auto_complete_for :post, :title
  end

  # View
  &lt;%= text_field_with_auto_complete :post, :title %&gt;</description>
    </item>
    <item rdf:about="https://tech.solin.eu/doku.php?id=ror:caching&amp;rev=1258148134&amp;do=diff">
        <dc:format>text/html</dc:format>
        <dc:date>2009-11-13T21:35:34+00:00</dc:date>
        <title>ror:caching</title>
        <link>https://tech.solin.eu/doku.php?id=ror:caching&amp;rev=1258148134&amp;do=diff</link>
        <description>*  How To Prevent Asset Caching - How to renew the cached asset id (e.g. after rotating an image)
	*  How To Enable Caching - A primer on action caching
	*  Caching and Localization - Here, we dive into various aspects of caching localized pages
	*  Caching Nested Forms - You can configure nested routes to enable caching for nested forms</description>
    </item>
    <item rdf:about="https://tech.solin.eu/doku.php?id=ror:caching_and_localization&amp;rev=1314192933&amp;do=diff">
        <dc:format>text/html</dc:format>
        <dc:date>2011-08-24T13:35:33+00:00</dc:date>
        <title>ror:caching_and_localization</title>
        <link>https://tech.solin.eu/doku.php?id=ror:caching_and_localization&amp;rev=1314192933&amp;do=diff</link>
        <description>- Explain about default_url_options
- path_prefix to include locale in each url</description>
    </item>
    <item rdf:about="https://tech.solin.eu/doku.php?id=ror:caching_nested_forms&amp;rev=1258406000&amp;do=diff">
        <dc:format>text/html</dc:format>
        <dc:date>2009-11-16T21:13:20+00:00</dc:date>
        <title>ror:caching_nested_forms</title>
        <link>https://tech.solin.eu/doku.php?id=ror:caching_nested_forms&amp;rev=1258406000&amp;do=diff</link>
        <description>Normally, using a nested resource's url leads you to the controller of the “embedded” resource. E.g:


  map.resources :guests, :has_many =&gt; :registrations


Produces:


    guest_registrations GET    /guests/:guest_id/registrations(.:format)           {:controller=&gt;&quot;registrations&quot;, :action=&gt;&quot;index&quot;}
                        POST   /guests/:guest_id/registrations(.:format)           {:controller=&gt;&quot;registrations&quot;, :action=&gt;&quot;create&quot;}
 new_guest_registration GET    /guests/:guest_id/registrations/ne…</description>
    </item>
    <item rdf:about="https://tech.solin.eu/doku.php?id=ror:class_instance_variable_vs_class_variables&amp;rev=1222085177&amp;do=diff">
        <dc:format>text/html</dc:format>
        <dc:date>2008-09-22T12:06:17+00:00</dc:date>
        <title>ror:class_instance_variable_vs_class_variables</title>
        <link>https://tech.solin.eu/doku.php?id=ror:class_instance_variable_vs_class_variables&amp;rev=1222085177&amp;do=diff</link>
        <description>Class Variables in Ruby are unlike class variables in many other programming variables. If you change the value of a class variable, all class variables in the inheritance chain are changed to this new value too. This is explained by Martin Fowler, right here.</description>
    </item>
    <item rdf:about="https://tech.solin.eu/doku.php?id=ror:code_samples&amp;rev=1238936852&amp;do=diff">
        <dc:format>text/html</dc:format>
        <dc:date>2009-04-05T13:07:32+00:00</dc:date>
        <title>ror:code_samples</title>
        <link>https://tech.solin.eu/doku.php?id=ror:code_samples&amp;rev=1238936852&amp;do=diff</link>
        <description>Outputting the Alphabet


    &lt;% &quot;A&quot;.upto(&quot;Z&quot;) do |c| %&gt;
      &lt;li &lt;%= 'class=&quot;current&quot;' if (session['wordlist'] == c.downcase) %&gt;&gt;
        &lt;%= link_to '&lt;span&gt;' + c + '&lt;/span&gt;', {:action =&gt; 'list', :character =&gt; c.downcase} %&gt;
      &lt;/li&gt;              	
    &lt;% end %&gt;</description>
    </item>
    <item rdf:about="https://tech.solin.eu/doku.php?id=ror:error_handling_and_validation&amp;rev=1278946988&amp;do=diff">
        <dc:format>text/html</dc:format>
        <dc:date>2010-07-12T15:03:08+00:00</dc:date>
        <title>ror:error_handling_and_validation</title>
        <link>https://tech.solin.eu/doku.php?id=ror:error_handling_and_validation&amp;rev=1278946988&amp;do=diff</link>
        <description>Standard Methods

First of all, take a look at Class
ActiveRecord::Errors. Here are pretty decent error methods to start with.

Dirty Details

The error_messages_for method outputs neatly formatted error messages for a given object. The catch is that you need to specify the name of the instance variable here, not the object name itself. Take the following example.</description>
    </item>
    <item rdf:about="https://tech.solin.eu/doku.php?id=ror:how_to_enable_caching&amp;rev=1258147889&amp;do=diff">
        <dc:format>text/html</dc:format>
        <dc:date>2009-11-13T21:31:29+00:00</dc:date>
        <title>ror:how_to_enable_caching</title>
        <link>https://tech.solin.eu/doku.php?id=ror:how_to_enable_caching&amp;rev=1258147889&amp;do=diff</link>
        <description>In and by itself, caching is not very difficult in Rails. The most immediately useful type of caching is action caching (because you can combine it with authentication). You can just use call caches_action in your controller file, giving the action to be cached as an arugment:</description>
    </item>
    <item rdf:about="https://tech.solin.eu/doku.php?id=ror:how_to_prevent_asset_caching&amp;rev=1314192933&amp;do=diff">
        <dc:format>text/html</dc:format>
        <dc:date>2011-08-24T13:35:33+00:00</dc:date>
        <title>ror:how_to_prevent_asset_caching</title>
        <link>https://tech.solin.eu/doku.php?id=ror:how_to_prevent_asset_caching&amp;rev=1314192933&amp;do=diff</link>
        <description>How To Prevent Caching

Rails has some pretty strong caching mechanisms. As of Rails 2.0.1 (or thereabouts), caching is sometimes too persistent. The asset id's are the numbers following an image url:


/images/thumbnails/0000/0070/image7_thumb.jpg?1221837030</description>
    </item>
    <item rdf:about="https://tech.solin.eu/doku.php?id=ror:installing_and_configuring&amp;rev=1229802959&amp;do=diff">
        <dc:format>text/html</dc:format>
        <dc:date>2008-12-20T19:55:59+00:00</dc:date>
        <title>ror:installing_and_configuring</title>
        <link>https://tech.solin.eu/doku.php?id=ror:installing_and_configuring&amp;rev=1229802959&amp;do=diff</link>
        <description>Installing and configuring Ruby on Rails

Ruby on Rails requires:

	* Ruby (the programming language)
	* RubyGems (This the standard Ruby package manager. It's similar to apt-get, emerge, and other OS package managers.)

I have closely followed the instructions of the book “Agile Web Development With Rails” to get Ruby on Rails installed.</description>
    </item>
    <item rdf:about="https://tech.solin.eu/doku.php?id=ror:making_code_blocks_with_ampersand&amp;rev=1224074074&amp;do=diff">
        <dc:format>text/html</dc:format>
        <dc:date>2008-10-15T12:34:34+00:00</dc:date>
        <title>ror:making_code_blocks_with_ampersand</title>
        <link>https://tech.solin.eu/doku.php?id=ror:making_code_blocks_with_ampersand&amp;rev=1224074074&amp;do=diff</link>
        <description>Enumerable objects, such as arrays, have iterator methods which take a code block as an argument. Here's an example as it may appear in a Rails project:


@users = User.find(:all)
usernames = @users.collect {|user| user.login}


Here, the collect method returns an array with the results of running the code block once for every user object in the @users array. The code block executes the “login” attr_reader method, so all logins  are collected in an array called usernames.</description>
    </item>
    <item rdf:about="https://tech.solin.eu/doku.php?id=ror:operators_precedence_table&amp;rev=1314192933&amp;do=diff">
        <dc:format>text/html</dc:format>
        <dc:date>2011-08-24T13:35:33+00:00</dc:date>
        <title>ror:operators_precedence_table</title>
        <link>https://tech.solin.eu/doku.php?id=ror:operators_precedence_table&amp;rev=1314192933&amp;do=diff</link>
        <description>Operators Precedence Table

(High to low precedence)
 Operator  Description  [ ] [ ]=  Element reference, element set 
**
 Exponentiation 
irb(main):002:0&gt; 2 ** 3 =&gt; 8
 ! ~ + -  Not, complement, unary plus and minus (method names for the last two are +@ and -@)  
* / %</description>
    </item>
    <item rdf:about="https://tech.solin.eu/doku.php?id=ror:plugins&amp;rev=1314192933&amp;do=diff">
        <dc:format>text/html</dc:format>
        <dc:date>2011-08-24T13:35:33+00:00</dc:date>
        <title>ror:plugins</title>
        <link>https://tech.solin.eu/doku.php?id=ror:plugins&amp;rev=1314192933&amp;do=diff</link>
        <description>Here, we provide some of experiences with various plugins.

	*  auto_complete This used to be a core feature, but since Rails 2, this is a plugin</description>
    </item>
    <item rdf:about="https://tech.solin.eu/doku.php?id=ror:rails_related_issues&amp;rev=1449583177&amp;do=diff">
        <dc:format>text/html</dc:format>
        <dc:date>2015-12-08T13:59:37+00:00</dc:date>
        <title>ror:rails_related_issues</title>
        <link>https://tech.solin.eu/doku.php?id=ror:rails_related_issues&amp;rev=1449583177&amp;do=diff</link>
        <description>This section is mostly about non-Rails and non-Ruby issues, but they're closely related.

Character encoding in Rails and DB migrations

See part 2 for solution of troubles described in this section

If you have an MS SQL Server database which must be migrated to MySQL, chances are good that you'll run into some nasty character encoding issues. MS SQL Server usually encodes all textual data in latin1 (ISO 8859-1, see http://en.wikipedia.org/wiki/ISO-8859-1). You can, of course, use this encoding…</description>
    </item>
    <item rdf:about="https://tech.solin.eu/doku.php?id=ror:ruby&amp;rev=1243662741&amp;do=diff">
        <dc:format>text/html</dc:format>
        <dc:date>2009-05-30T05:52:21+00:00</dc:date>
        <title>ror:ruby</title>
        <link>https://tech.solin.eu/doku.php?id=ror:ruby&amp;rev=1243662741&amp;do=diff</link>
        <description>*  Operators Precedence Table
	*  Class Instance Variable vs Class Variables
	*  Making Code Blocks With &amp; (Ampersand)
	*  Sorting an array by multiple properties or objects</description>
    </item>
    <item rdf:about="https://tech.solin.eu/doku.php?id=ror:ruby_on_rails&amp;rev=1256328218&amp;do=diff">
        <dc:format>text/html</dc:format>
        <dc:date>2009-10-23T20:03:38+00:00</dc:date>
        <title>ror:ruby_on_rails</title>
        <link>https://tech.solin.eu/doku.php?id=ror:ruby_on_rails&amp;rev=1256328218&amp;do=diff</link>
        <description>When we started using RoR in 2005, we had to learn a lot. Most of what we came across is also documented elsewhere, especially the installation and configuration process.

For the Rails novice however, this little wiki may prove valuable. Anyway, go see for yourself.</description>
    </item>
    <item rdf:about="https://tech.solin.eu/doku.php?id=ror:sorting_an_array_by_multiple_properties_or_objects&amp;rev=1243662970&amp;do=diff">
        <dc:format>text/html</dc:format>
        <dc:date>2009-05-30T05:56:10+00:00</dc:date>
        <title>ror:sorting_an_array_by_multiple_properties_or_objects</title>
        <link>https://tech.solin.eu/doku.php?id=ror:sorting_an_array_by_multiple_properties_or_objects&amp;rev=1243662970&amp;do=diff</link>
        <description>Use the Ruby sort_by method (available to all enumerables, not just arrays). A direct “reassignment” of the array variable does not seem to work, you have to empty the array first:


    prices = (@period.prices.sort_by {|p| [p.invoice_item_type.asset_type.name, p.invoice_item_type.label] })
    @period.prices = []
    @period.prices = prices</description>
    </item>
    <item rdf:about="https://tech.solin.eu/doku.php?id=ror:test_driven_development&amp;rev=1254341847&amp;do=diff">
        <dc:format>text/html</dc:format>
        <dc:date>2009-09-30T20:17:27+00:00</dc:date>
        <title>ror:test_driven_development</title>
        <link>https://tech.solin.eu/doku.php?id=ror:test_driven_development&amp;rev=1254341847&amp;do=diff</link>
        <description>RSpec

Redirecting Spec's html Output to Browser

Use spec -fh to have Spec output its test results in nicely formatted html. Example:


spec -fh spec/models/person_spec.rb


Of course, html output on the prompt isn't really all that nice, so let's redirect the html to a browser:</description>
    </item>
    <item rdf:about="https://tech.solin.eu/doku.php?id=ror:the_basics&amp;rev=1223643852&amp;do=diff">
        <dc:format>text/html</dc:format>
        <dc:date>2008-10-10T13:04:12+00:00</dc:date>
        <title>ror:the_basics</title>
        <link>https://tech.solin.eu/doku.php?id=ror:the_basics&amp;rev=1223643852&amp;do=diff</link>
        <description>Version Control

Be careful not to include the following files into your version control system:

	* /config/database.yml
	* contents of /log
	* contents of /tmp
	* public/dispatch.* files: if you're using e.g. InstantRails on Windows, the #! bang line which calls ruby is bound to be wrong on your remote system (i.e. live server)
	* public/.htaccess: might be different on your remote system.  If you're using webricks locally then .htaccess is not used, but it's cleaner to keep it out of svn.</description>
    </item>
    <item rdf:about="https://tech.solin.eu/doku.php?id=ror:validation&amp;rev=1221558807&amp;do=diff">
        <dc:format>text/html</dc:format>
        <dc:date>2008-09-16T09:53:27+00:00</dc:date>
        <title>ror:validation</title>
        <link>https://tech.solin.eu/doku.php?id=ror:validation&amp;rev=1221558807&amp;do=diff</link>
        <description>LiveValidation Plugin

The  livevalidation plugin reads your model-based validation rules (e.g. “validates_presence_of”) and turns them into client-side javascript-based form validation.  Here's the API of the plugin: http://livevalidation.rubyforge.org. By and large, this plugin works okay. There are a few pitfalls though.</description>
    </item>
</rdf:RDF>
