Edit the config/environment.rb and add the following:
config.logger = Logger.new("#{RAILS_ROOT}/log/#{ENV['RAILS_ENV']}.log", 5, 10*1024*1024)
Where the 2nd and 3rd parameters are defined here.
Edit the config/environment.rb and add the following:
config.logger = Logger.new("#{RAILS_ROOT}/log/#{ENV['RAILS_ENV']}.log", 5, 10*1024*1024)
Where the 2nd and 3rd parameters are defined here.
Facebook looks at the meta="description" element of the shared link to determine its excerpt. The following link discusses how to do this:
Matthew Ebel » Blog Archive » Adding WP Post Excerpts to Facebook Links
The process requires modifying the header of your current theme, usually the header.php.
It’s also possible that the meta="description" element is missing in your theme (like in CRC‘s Suffusion theme). If that’s the case, just add the missing element.
[EDIT: Ditched this and went with All in One SEO Pack plugin instead.]
Apache mod_rewrite doesn’t work even if all of the .htaccess settings are correct.
The settings in /etc/apache2/sites-enabled/000-default for /var/www/ is set to AllowOverride None.
Change the setting to AllowOverride All.
Member routes allow one to create additional routes to existing resources. For example, if you want to add an approve path to your purchases resource, you could do this in your config/routes.rb:
map.resources :purchases, :member => { :approve => :put }
My problem was that the link I made for approving the purchase
<%= link_to "Approve Purchase", approve_purchase_path(@purchase), :confirm => "Proceed with approval?" %>
resulted in the following error:
Unknown action
No action responded to 1. Actions: approve, create, destroy, edit, index, new, show, and update
Rails confused the link with a normal get operation.
Explicitly declare the HTTP method for the action.
<%= link_to "Approve Purchase", approve_purchase_path(@purchase), :confirm => "Proceed with approval?", :method => :put %>
When developing for Ruby on Rails, the development server (the one used by script/server) feels slow and unresponsive.
RoR uses WEBrick as the default server. Based on my experience on a Ubuntu virtual machine with 1GB of RAM, this server doesn’t respond as fast as the web application servers in other web languages (Apache, Tomcat, IIS).
Install Mongrel. In Ubuntu 9.04, you can install this using:
sudo gem install mongrel
In case you receive build errors, you might have to install ruby-dev to deal with the dependency issues.
sudo apt-get install ruby-dev
Once installed, Rails will automatically use Mongrel as the application server over WEBrick.