Trouble Using Attr_Accessor in Rails Models and Forms
You might use the attr_accessible method to create getters and setters for a class that has attributes which don't map directly to corresponding fields in a database. For example let's take the scenario where you are processing a credit card transaction. ...
Written by Sean Behan on 06/17/2012
Gem Information with Gem List
If you want to get version information about a gem the easiest way to do it is with this command
gem list
For example
gem list activemerchant
will output the activemerchant versions I have installed. You can pass only part of the name like
gem list ...
Written by Sean Behan on 06/17/2012
OpenSSL Certificate Generation Information for Certificate Authority to Serve Traffic Over Https
apt-get install openssl
openssl genrsa -des3 -out server.key 1024
openssl req -new -key server.key -out server.csr
You'll be prompted to enter a password (don't forget it!) as well as fill in company identity information. The most important part is the ...
Written by Sean Behan on 06/17/2012
Install Sphinx on Ubuntu
It's a pretty straightforward process. Download the source and compile it. There isn't a package for it so here are the commands.
wget http://sphinxsearch.com/downloads/sphinx-0.9.8.1.tar.gz
tar xzvf sphinx-0.9.8.1.tar.gz
cd sphinx-0.9.8.1/
./configure...
Written by Sean Behan on 06/17/2012
Chunk an FLV File into Multiple Parts
The format is as follows
ffmpeg -i <input file> -ss <starting point> -t <length of capture> <output file>
ffmpeg -i Input_File.flv -ss 00:00:00 -t 00:10:00 Output_Filename.flv
http://www.surfthedream.com.au/blog/Archives/november...
Written by Sean Behan on 06/17/2012
David Heinemeier Hansson - Ruby on Rails, Startups, Culture
[youtube]http://www.youtube.com/watch?v=sb2xzeWf-PM[/youtube]
Written by Sean Behan on 06/17/2012
Ruby on Rails vs. PHP in a Nutshell
[youtube]http://www.youtube.com/watch?v=p5EIrSM8dCA[/youtube]
Written by Sean Behan on 06/17/2012
Nested Has_one Relationship with Fields_for and Attr_accessible in Model Class
To make child attributes accessible to your model through a nested forms (Rails 2.3) you'll need to add the "#{child_class}_attributes" to the attr_accessible method in your parent class. If you don't use attr_accessible in your parent model (you would do...
Written by Sean Behan on 06/17/2012
Joining Technorati
yuw3dqxzp2
Written by Sean Behan on 06/17/2012
Nested Attributes in a Form for Has_One Model Association in Rails
Just for reference...
class Member < ActiveRecord::Base
has_one :member_profile
accepts_nested_attributes_for :member_profile
end
...
Written by Sean Behan on 06/17/2012