0
嗯,我有Omniauth IM网站使用设计的宝石和所有工作正常,但在Sign_in鉴于我表现的供应商如何改变供应商的名称
<%- if devise_mapping.omniauthable? %>
<%- resource_class.omniauth_providers.each do |provider| %>
<%= link_to "#{OmniAuth::Utils.camelize(provider)},", omniauth_authorize_path(resource_name, provider), class: "#{provider} bold" %>
<% end -%>
<% end -%>
问题是因为视图显示:
Facebook,微博,GoogleOauth2
GoogleOauth2看起来很可怕,所以我怎么能更改名称GoogleOauth2为“谷歌”我想这个但没有窝ķ
<%- if devise_mapping.omniauthable? %>
<%- resource_class.omniauth_providers.each do |provider| %>
<% provider = "Google" if provider == "GoogleOauth2" %>
<%= link_to "#{OmniAuth::Utils.camelize(provider)},", omniauth_authorize_path(resource_name, provider), class: "#{provider} bold" %>
<% end -%>
<% end -%>
提供商:
色器件:omniauthable,omniauth_providers:[:脸谱,:微博:google_oauth2]
我也试图与此 “google_oauth2”:
<%- if devise_mapping.omniauthable? %>
<%- resource_class.omniauth_providers.each do |provider| %>
<% provider = "Google" if provider == "google_oauth2" %>
<%= link_to "#{OmniAuth::Utils.camelize(provider)},", omniauth_authorize_path(resource_name, provider), class: "#{provider} bold" %>
<% end -%>
<% end -%>
没有工作,哥哥:(我的代码: <% - 如果devise_mappi ng.omniauthable? %> <% - resource_class.omniauth_providers.each do | provider | %> <%provider =“Google”if provider ==“GoogleOauth2”%> <%= link_to“#{OmniAuth :: Utils.camelize(provider)}”,omniauth_authorize_path(resource_name,provider),class:“ #{provider} bold“%> <% end -%> <% end -%> –
用该代码更新问题(在评论中是硬读代码)。 –
谢谢我已经更新了 –