我正在安装Engage!
我按照此处的安装说明进行操作:http: //engagecsm.com/readme
我做的安装步骤:
- 添加参与!到应用程序的 Gemfile:gem 'engagecsm'。
- 安装它:捆绑安装。
- 运行生成器:rails generate 参与用户。
- 运行迁移:rake db:migrate。
现在,我可以去 localhost:3000/engage
这是显示的内容:
现在,当我点击“创建主题”时,网站上什么也没有发生。我查看我的 Rails 服务器控制台,我看到了这个:(更容易在此处查看http://i.stack.imgur.com/xKBER.png,在底部找到完整的堆栈跟踪)
"✓"," "authenticity_token"=">"aRKQAwMsnc1DJJ62S6bb7EkhFkzuCDtNL0kV756LIP4="," "topic"=">{"style"=>"question"," "title"=">"ww"," "message"=">"www"," "follow"=">"1"}," "commit"=">"Create" topic"}="" user="" load="" (0.3ms)="" select="" "users".*="" from="" "users"="" where="" "users"."id"="1" limit="" 1="" engage::userprofile="" (0.4ms)="" "engage_user_profiles".*="" "engage_user_profiles"="" "engage_user_profiles"."user_id"="1" (0.1ms)="" begin="" transaction="" inner="" join="" on="" ."id"="" sql="" (1.2ms)="" insert="" into="" "engage_topics"="" ("comments_count",="" "created_at",="" "followers_count",="" "message",="" "private",="" "status",="" "string",="" "style",="" "title",="" "updated_at",="" "user_id",="" "votes_count")="" values="" (?,="" ?,="" ?)="" [["comments_count",="" 0],="" ["created_at",="" sun,="" 20="" jan="" 2013="" 02:48:26="" utc="" +00:00],="" ["followers_count",="" ["message",="" "www"],="" ["private",="" false],="" ["status",="" "pending"],="" ["string",="" nil],="" ["style",="" "question"],="" ["title",="" "ww"],="" ["updated_at",="" ["user_id",="" 1],="" ["votes_count",="" 0]]="" engage::following="" "engage_followings".*="" "engage_followings"="" "engage_followings"."topic_id"="7" and="" "engage_followings"."user_id"="1" (0.2ms)="" binary="" data="" inserted="" <code>string<="" code>="" type="" column="" <code>token<="" (0.9ms)="" ("created_at",="" "token",="" "topic_id",="" "user_id")="" [["created_at",="" ["token",="" "5813db34aaedfa6226cf77b7a17d5dfbcf8d4560"],="" ["topic_id",="" 7],="" 1]]="" engage::topic="" "engage_topics".*="" "engage_topics"."id"="7" order="" created_at="" desc="" (0.8ms)="" update="" set="" "followers_count"="COALESCE("followers_count"," 0)="" +="" in="" (select="" desc)="" (3.8ms)="" commit="" rollback="" completed="" 500="" internal="" server="" error="" 71msactivemodel::massassignmentsecurity::error="" (can't="" mass-assign="" protected="" attributes:="" user):="" activemodel="" (3.2.11)="" lib="" active_model="" mass_assignment_security="" sanitizer.rb:48:in="" <code>process_removed_attributes'="" sanitizer.rb:20:in<="" code>debug_protected_attribute_removal'="" sanitizer.rb:12:in="" `sanitize'"="">
所以我开始用谷歌搜索,我看到这样的事情:
我已经将 attr_accessible :user 添加到我的用户模型中,但这不起作用。
这是我的用户模型:
另外,我看不到我如何访问 Engage 模型等,请参阅这里的目录:
有谁知道如何解决这一问题?如果您需要任何其他信息,请告诉我,我将提供屏幕截图。
任何帮助是极大的赞赏。谢谢!
编辑 #1 - 添加应用程序控制器图片和完整堆栈跟踪
这是我唯一可以通过 Engage 看到任何东西的地方!在控制器中(此时我没有用户控制器)
这是完整的堆栈跟踪:
"✓"," "authenticity_token"=">"aRKQAwMsnc1DJJ62S6bb7EkhFkzuCDtNL0kV756LIP4="," "topic"=">{"style"=>"question"," "title"=">"ww"," "message"=">"www"," "follow"=">"1"}," "commit"=">"Create" topic"}="" user="" load="" (0.3ms)="" select="" "users".*="" from="" "users"="" where="" "users"."id"="1" limit="" 1="" engage::userprofile="" (0.4ms)="" "engage_user_profiles".*="" "engage_user_profiles"="" "engage_user_profiles"."user_id"="1" (0.1ms)="" begin="" transaction="" inner="" join="" on="" ."id"="" sql="" (1.2ms)="" insert="" into="" "engage_topics"="" ("comments_count",="" "created_at",="" "followers_count",="" "message",="" "private",="" "status",="" "string",="" "style",="" "title",="" "updated_at",="" "user_id",="" "votes_count")="" values="" (?,="" ?,="" ?)="" [["comments_count",="" 0],="" ["created_at",="" sun,="" 20="" jan="" 2013="" 02:48:26="" utc="" +00:00],="" ["followers_count",="" ["message",="" "www"],="" ["private",="" false],="" ["status",="" "pending"],="" ["string",="" nil],="" ["style",="" "question"],="" ["title",="" "ww"],="" ["updated_at",="" ["user_id",="" 1],="" ["votes_count",="" 0]]="" engage::following="" "engage_followings".*="" "engage_followings"="" "engage_followings"."topic_id"="7" and="" "engage_followings"."user_id"="1" (0.2ms)="" binary="" data="" inserted="" <code>string<="" code>="" type="" column="" <code>token<="" (0.9ms)="" ("created_at",="" "token",="" "topic_id",="" "user_id")="" [["created_at",="" ["token",="" "5813db34aaedfa6226cf77b7a17d5dfbcf8d4560"],="" ["topic_id",="" 7],="" 1]]="" engage::topic="" "engage_topics".*="" "engage_topics"."id"="7" order="" created_at="" desc="" (0.8ms)="" update="" set="" "followers_count"="COALESCE("followers_count"," 0)="" +="" in="" (select="" desc)="" (3.8ms)="" commit="" rollback="" completed="" 500="" internal="" server="" error="" 71ms"="">
编辑#2 - 添加参与环境:
此外,我们还安装了 Devise(我相信还有 OmniAuth……)。因此,我们有“current_user”,但我不知道我们是否有“用户名”或“电子邮件”方法,除非这是 Devise 或其他东西的标准
编辑#3 - 正如 Geoff 建议的那样,我查看了 topic_controller 的第 46 行。该行如下:
@topic.votes.create(:user =>engage_current_user)