经过多次反复试验,我已将问题缩小到下面第5行.出于某种原因,.js响应正在结束用户会话.使用3.0.4并设计1.1.7(和jQuery 1.5).
此外,正在更新@organization并在日志中显示Completed 200 OK,因此在尝试下一个操作之前,用户不知道他/她已注销.
非常感谢任何帮助和指导.
*Controller*
1 def make_featured
2 @organization = Organization.find(params[:id])
3 @organization.is_featured ? @organization.update_attribute(:is_featured,"false") : @organization.update_attribute(:is_featured,"true")
4 respond_to do |format|
5 format.js {render :action => "update", :layout => false}
6 end
7 end
Run Code Online (Sandbox Code Playgroud)
和
*update.js.haml*
$("#organization_" + "#{@organization.id}" ).replaceWith("#{ escape_javascript(render :partial => 'users/supplier_view', :locals => {:organization => @organization}) }");
Run Code Online (Sandbox Code Playgroud) 我正在构建一个应用程序,需要一个两步过程来为其中一个模型创建一个对象.
我考虑过......
创建自定义"新"操作的自定义路由
要么
对两个步骤使用相同的"新"操作,但基于参数渲染正确的视图
处理这个问题的最佳方法是什么?
我希望我的应用程序的邀请来自邀请者,而不是系统电子邮件地址.如何从devise.rb覆盖config.mailer_sender?
我在我的邮件中有这个并确认它已被调用,但它没有覆盖:from.注意:它是一个私有方法,我把它作为一个公共方法尝试,没有任何效果.
private
def headers_for(action)
if action == :invitation_instructions
headers = {
:subject => "#{resource.invited_by.full_name} has invited you to join iTourSmart",
:from => resource.invited_by.email,
:to => resource.email,
:template_path => template_paths
}
else
headers = {
:from => mailer_sender(devise_mapping),
:to => resource.email,
:template_path => template_paths
}
end
if resource.respond_to?(:headers_for)
headers.merge!(resource.headers_for(action))
end
unless headers.key?(:reply_to)
headers[:reply_to] = headers[:from]
end
headers
end
Run Code Online (Sandbox Code Playgroud) 有没有人知道维护的gem通过现有的Rails 3应用程序处理Zendesk API的用户身份验证?
我问了Zendesk IT并被发送到https://github.com/tobias/zendesk_remote_auth,但它看起来并不兼容rails 3并且自2009年以来一直没有更新.