开发者

Devise authenticates before user/<id> but I want to turn it off

开发者 https://www.devze.com 2023-02-19 02:02 出处:网络
I\'ve got Devise working on my Ruby on Rails application but viewing the user requires authentication 开发者_StackOverflow社区and I don\'t want that. I\'ve tried setting authenticate_user like so:

I've got Devise working on my Ruby on Rails application but viewing the user requires authentication 开发者_StackOverflow社区and I don't want that. I've tried setting authenticate_user like so:

class UsersController < ApplicationController
  before_filter :authenticate_user!, :except => [:show, :index]
  ..
end

But it still redirects to the sign_in page. Can anyone point me in the right direction?

Cheers,

Rim

PS: Please excuse my n00b-ness


Doh!

I was getting confused and had the wrong path. I been scratching my head for ages on that.

I fixed it...


I always use to copy controller files from devise gem folder to my applications controller folder

The devise controller files can be found here /usr/lib/ruby/gems/1.8/gems/devise-1.1.2/app/controllers/ (may be at different location in your case)

Copy devise folder in there and paste it to app/controllers/ and then customize registrations_controller as per your need

But I believe there must be some good solution on this. By the time you can use this.. :)

0

精彩评论

暂无评论...
验证码 换一张
取 消