Missing Template Error on create and update

41 views
Skip to first unread message

Galen

unread,
Dec 9, 2009, 5:07:13 AM12/9/09
to Authlogic
I've got Facebook nearly working.

My (hopefully) last issue regards redirects.

After a user creates or updates, rails isn't properly redirecting.

Instead it's raising this error:
ActionView::MissingTemplate (Missing template users/create.erb in view
path app/views)


If I save inline instead of as a block, the issue goes away (but that
disables facebook_connect).

As a probably related issue, validations don't validate (likely
because they're not redirected to the originating form).

The user DOES save if there are no validation errors. Only, they don't
get redirected to the proper action.

They're redirected to mysite.com/account, but stopped as rails looks
for the create.erb or update.erb template.

I'm on Rails 2.3.4, Passenger, and Ruby 1.8.7.

My routes look like this:

map.resources :users do |user|
user.resources :votes
user.resources :stories do |story|
story.resources :votes
end
end

map.resource :account, :controller => "users"


The only recent change I made was to add a before_filter except on the
edit, update and create actions that looks like this:

def require_username
if current_user
unless current_user.login.present?
flash[:notice] = "Please choose a username to represent
you."
redirect_to edit_account_url
end
end
end

Googling has turned up nary a lead. Any ideas?

Galen

unread,
Dec 9, 2009, 5:51:29 PM12/9/09
to Authlogic
This seems to approach the issue, but the bug was apparently fixed
when the bug was reported a year ago!

Still occurring for me.

https://rails.lighthouseapp.com/projects/8994/tickets/1590-xhrs-require-explicit-respond_to

Galen

unread,
Dec 9, 2009, 5:55:04 PM12/9/09
to Authlogic
Something similar, but with Open_ID:

http://github.com/tsechingho/authlogic_bundle/issues#issue/6

On Dec 10, 7:51 am, Galen <withga...@gmail.com> wrote:
> This seems to approach the issue, but the bug was apparently fixed
> when the bug was reported a year ago!
>
> Still occurring for me.
>
> https://rails.lighthouseapp.com/projects/8994/tickets/1590-xhrs-requi...

chrohrer

unread,
Dec 10, 2009, 2:39:07 AM12/10/09
to Authlogic
I ran into the same problem yesterday with Authlogic 2.1.3, Passenger
2.2.7 and Rails 2.3.5.

If you find a solution, could you please let me know.

Cheers
Christian

Galen

unread,
Dec 10, 2009, 6:41:16 PM12/10/09
to Authlogic
http://groups.google.com/group/compass-users/browse_thread/thread/c51c49e252c550f1

In the above link, Chris Eppstein points out that Active Record's Base
Save command doesn't account for blocks.

So the issue seems to be, OpenID and Facebook need to save as a block
(and that works just fine), but normal rails models need to save in
the format of "if @user.save ... else ... end"

How to reconcile?
Reply all
Reply to author
Forward
0 new messages