0

我正在尝试编写一个 rails 4.2.0.beta2 应用程序,该应用程序将允许我们的组织直接与我们的 salesforce 实例交互。

我一直在这里关注这个非常有用的条目。

我快到了,我已经在 salesforce 中设置了我的应用程序,它似乎正在触发请求,我可以进入登录页面并输入我的信息。

但是,我在回调时收到以下错误。

ActiveModel::ForbiddenAttributesError in SessionsController#create
ActiveModel::ForbiddenAttributesError

enter code hereExtracted source (around line #21):

  def sanitize_for_mass_assignment(attributes)
    if attributes.respond_to?(:permitted?) && !attributes.permitted?
      raise ActiveModel::ForbiddenAttributesError
    else
      attributes
    end

我查看了我的 Sessions 控制器,这可能会导致我出现问题......但我无法弄清楚发生了什么。

谁能发现我在这里出错的地方?

class SessionsController < ApplicationController
    def create
      user = User.from_omniauth(env["omniauth.auth"])
      session[:user_id] = user.id
      redirect_to root_url
    end

    def destroy
      session[:user_id] = nil
      redirect_to root_url
    end
end
4

1 回答 1

0

解决了与这篇文章这个错误有关的问题。

于 2014-11-10T12:23:07.790 回答