Go to your application_controler.rb and add this method


def xxx function
raise function .inspect
end

save the file and restart the server if required, now anywhere in your controller you can do this


xxx User.all

or you can do


xxx params

ofcourse you can name this method what ever you want, but I use xxx because its quick to type and I won’t override other method “no descent application would have such a method called xxx” :)

Are you getting ‘not authorized to access newname’ error?

cd myapp .git/config

 repositoryformatversion = 0
 filemode = true
 bare = false
 logallrefupdates = true
[remote "heroku"]
 url = git@heroku.com:<span style="color: #ff0000;">newname</span>.git
 fetch = +refs/heads/*:refs/remotes/heroku/*

change newname to the your project name

push again, it should be fixed

The easier way to send email from rails application, this is what the guys at PostageApp say at their website frontpage, and thats absolutely true.

Last night I was building an app that use Nokogiri gem to do screen scraping for the frontpage of a client website and put it thenĀ in a template to be ready for sending through rails mailer.

I have thousands of subscripers in the database, how I’m going to make rails mailer send the message to all of them, phplist used to take several houres to finish, should I use cronjob or what?

http://postageapp.com do it for you, with few easy steps their plugin will be installed and with no configuration at all, postageapp will do the dirty work between your rails app and the mail server.

really really nice plugin,
rails developers keep surprising us everyday.