This is helpful to have the single login for multiple level domains.

Edit your environment configuration and add something like this;

(E.g in environment.rb or production.rb)

config.action_controller.session = {:domain => “.arthurneil.com”, :key => ‘_arthurs_session_id’, :secret => ‘4gfsdf234jmfv35ksdf23m44m4m4neserf345′}

Likewise, to target the cookies based on particular domain, try;

(E.g)

cookies[:my_test_cookie] = {:value => “test”, :expires => 365.days.from_now,:domain => ‘.arthurneil.com’}

” Arthur Neil “.squeeze(” “).strip

To find empty characters/space in a filed; use

if params[:description].squeeze(” “).strip.length == 0
[handle it here]
end

First-year students at Veterinary school were attending their first Anatomy class, with a real dead pig.

They all gathered around the surgery table with the body covered with a White sheet. The professor started the class by telling them, ‘In Veterinary Medicine it is necessary to have two important qualities as a Doctor: The first is that you not be disgusted by anything involving the Animal body’. For an example, the Professor pulled back the sheet, touched his finger in the mouth of the dead pig, withdrew it and put his Finger in his mouth. ‘Go ahead and do the same …

If you have recently updated to Rails 2.2 or +, you may encounter this error:

/usr/lib/ruby/gems/1.8/gems/activesupport-2.3.2/lib/active_support/dependencies.rb:443:in `load_missing_constant’: uninitialized constant Inflector (NameError)
from /usr/lib/ruby/gems/1.8/gems/activesupport-2.3.2/lib/active_support/dependencies.rb:80:in `const_missing’
from /usr/lib/ruby/gems/1.8/gems/activesupport-2.3.2/lib/active_support/dependencies.rb:92:in `const_missing’
from /usr/local/rails/mogulus/vendor/plugins/active_merchant/lib/active_merchant/billing/integrations.rb:13
from /usr/lib/ruby/site_ruby/1.8/rubygems/custom_require.rb:27:in `gem_original_require’

Go to the error file;
/usr/local/rails/mogulus/vendor/plugins/active_merchant/lib/active_merchant/billing/integrations.rb

and replace;

Inflector.inflections do |inflect|
.
.
.
end

with;

ActiveSupport::Inflector.inflections do |inflect|
.
.
.
end

You may face some issues while configuring rails;

no such file to load — mysql
/usr/lib/ruby/site_ruby/1.8/rubygems/custom_require.rb:27:in `gem_original_require’
/usr/lib/ruby/site_ruby/1.8/rubygems/custom_require.rb:27:in `require’
/usr/lib/ruby/gems/1.8/gems/activesupport-2.3.2/lib/active_support/dependencies.rb:156:in `require’
/usr/lib/ruby/gems/1.8/gems/activerecord-2.3.2/lib/active_record/connection_adapters/mysql_adapter.rb:65:in `mysql_connection’
and so on

step 1:
If you havn’t done “gem install mysql”; do it first.

step 2:
If it doesn’t work even after “gem install mysql”; search for “mysql.so” in your system. In linux box; the path would be something like;
‘/usr/local/lib/ruby/gems/1.8/gems/mysql-2.7/mysql.so’

step 3:
In the error message; you will see the error file(mysql_adapter.rb); In my case it is [check error sample above];

/usr/lib/ruby/gems/1.8/gems/activerecord-2.3.2/lib/active_record/connection_adapters/mysql_adapter.rb:65:in `mysql_connection’

step 4:
Open the file “/usr/lib/ruby/gems/1.8/gems/activerecord-2.3.2/lib/active_record/connection_adapters/mysql_adapter.rb” and go to location 65.

You will find a line something like;

require_library_or_gem(’mysql’)

change this line to look like;

require_library_or_gem(’/usr/local/lib/ruby/gems/1.8/gems/mysql-2.7/mysql.so’)

Restart your app and ;)

Page 5 of 42« First...«34567»...Last »

Categories and Tags

Advertising