Showing posts with label plugin. Show all posts
Showing posts with label plugin. Show all posts

Monday, November 14, 2011

Configure FCK Editor with rails 2.3.x (undefined method 'relative_url_root')

If you are trying to install fckeditor along with rails 2.3.x and get the error like
undefined method 'relative_url_root' then simply follow the below steps.

We require to add some patch for that.

Go to the fckeditor folder of plugin. and add patch for fckeditor

app/controllers/fckeditor_controller.rb

def upload_directory_path
   Replace this line (#136)
      uploaded = request
.relative_url_root.to_s+"#{UPLOADED}/#{params[:Type]}"
   With
      uploaded = ActionController::Base
.relative_url_root.to_s+"#{UPLOADED}/#{params[:Type]}"
    "#{uploaded}#{params[:CurrentFolder]}"
  end

lib/fckeditor.rb

Replace this line (#38)
  js_path = "#{request.relative_url_root}/javascripts"
with
  js_path = "#{ActionController::Base.relative_url_root}/javascripts"

Now restart your server. It solve the above error and fckeditor now configure successfully with your application.

Monday, October 3, 2011

How to integrate newrelic rpm with rails

Hello,
          If you want to measure the performance (loading time) of your application than use newrelic rpm plugin/gem.

Either install newrelic plugin or gem.

script/plugin install http://newrelic.rubyforge.org/svn/newrelic_rpm
or
gem install newrelic_rpm
Add config.gem "newrelic_rpm" in environment.rb

Now in config edit the newrelic.yml
If you want to monitor application in development mode than set monitor mode

development:
  <<: *default_settings
   monitor_mode: true
   developer_mode: true

Now access the http://localhost:#{port}/newrelic. it shows the time consumption as per request. so from this you will get idea from where most time consumed. Based on that you can optimize the code to save time.


Want to get more information?
follow - https://github.com/mislav/newrelic_rpm