Updated Goldberg to run on rails 2.3.2

13 views
Skip to first unread message

lardawge

unread,
May 6, 2009, 11:22:41 AM5/6/09
to Ruby on Rails: Goldberg
I have forked goldberg on github and made changes to make it rails
2.3.2 compatible as well as minor bug fixes and enhancements. It may
get merged back into the master branch but for now here you go. Let me
know if anything new crops up as far as bugs with 2.3.2 and I will add
them to the repository.

http://github.com/lardawge/goldberg

enjoy!
Larry

James Silberbauer

unread,
May 6, 2009, 12:01:56 PM5/6/09
to rubyonrail...@googlegroups.com
Great stuff Larry, thanks.

I had to comment out line 46 in auth_controller.rb:

reset_session #double check there isn't a stale session

This leads to an invalid authenticity token error when I post the login
form.
Are you running without forgery protection?

James

lardawge

unread,
May 6, 2009, 1:19:22 PM5/6/09
to Ruby on Rails: Goldberg
Hi James,

"Are you running without forgery protection?"
No, forgery protection is on.

Is this on a fresh install or an upgraded app? Was it happening every
time? Rails 2.3.2?

lardawge

unread,
May 6, 2009, 1:43:32 PM5/6/09
to Ruby on Rails: Goldberg
PS, It shouldn't have anything to do with a post request since it is
is only accessed on a get request (see line 42: if request.get?). I
have this running on 2 apps with no problems.

On May 6, 12:01 pm, James Silberbauer <james...@telkomsa.net> wrote:

James Silberbauer

unread,
May 6, 2009, 2:25:45 PM5/6/09
to rubyonrail...@googlegroups.com
Hi Larry,

It happens every time.

This is an upgraded app - a copy of a rails 2.2.2 app running with 2.3.2.

I've been hacking away at it a bit to try to get rid of "A copy of
ApplicationController has been removed from the module tree but is still
active!" and similar errors related to reloading in development mode, so
there are a few changes to your code.

James

lardawge

unread,
May 6, 2009, 2:58:32 PM5/6/09
to Ruby on Rails: Goldberg
James,

I would suggest setting up a test app with a fresh install of goldberg
that was generated from rails 2.3.2... Just to have a comparison.

I just updated an app from 2.2.2 to 2.3.2 to see if there are any
conflicts and seems ok... Still can't reproduce any errors from the
login controller. You say it is only on a POST?

Please post any other changes if you would so we can keep Goldberg up
to date.

Regarding "A copy of ApplicationController has been removed from the
module tree but is still active!" I am having similar errors but it is
only happening when I go into edit or add an action in dev mode. I
have just grown used to restarting the app which sorts out the issue.

James Silberbauer

unread,
May 6, 2009, 4:23:46 PM5/6/09
to rubyonrail...@googlegroups.com
Hi Larry,

A deadline is going to take me away from this for a few days, but I'll
do some step-by-step testing soon.
Sure is odd!
I clear sessions, start the app, go to the home page, click the login
link, type in name & password and it bombs when I submit.
Happens in dev mode and production.
There is a before_filter in the application controller. Something in
there may be upsetting things.

I added 'unloadable' to each of Goldberg's controllers which seems
(after a pretty cursory check) to have resolved the
'ApplicationController removed' errors.
Inspired by this post:
http://nerbie69.blogspot.com/2008/12/solved-applicationcontroller-has-been.html

Other changes I have made are probably not of general use to everyone,
they are quick, rough hacks:
- In AuthController I commented out
# session[:goldberg][:menu_history][session[:goldberg][:path]] =
# session[:goldberg][:menu_item]
as I didn't seem to need the history and my session data was growing
pretty large.

- In filters.rb check_not_expired, I changed
format.js do
render :status => 400, :text =>
Goldberg.settings.session_expired_page.content_html
end
to
format.js do
render :update do |page|
page.redirect_to Goldberg.settings.session_expired_page.url
end
because the expired message was being swallowed by the browser so it
looked like the app wasn't returning.

James
Reply all
Reply to author
Forward
0 new messages