开发者

devise custom controller users old views

开发者 https://www.devze.com 2023-02-17 07:51 出处:网络
I\'m using Rails 3, with devise and have generated the devise views. Recently I\'ve had a requirement to create a custom controller to extend Devise::SessionsController, the problem is that once I ha

I'm using Rails 3, with devise and have generated the devise views.

Recently I've had a requirement to create a custom controller to extend Devise::SessionsController, the problem is that once I have my cust开发者_如何学运维om controller it doesn't use the devise views anymore.

Here is my custom controller app/controllers/sessions_controller.rb

class SessionsController < Devise::SessionsController
  def destroy
    # Add custom code.
    super
  end
end

I have to copy app/views/devise/sessions/new.html.haml to app/views/sessions to make it work, is there a better way to do this?

Can I still use the devise/sessions/new.html.haml view in my custom controller?


You could always create a symlink from the views/sessions to views/devise/sessions

0

精彩评论

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