如何在活动管理员的索引页面中将工具提示添加到操作项
How can i add tooltip to action item in my index page of active admin
在我的应用程序的管理门户中,我添加了操作项,点击它打开了新资源。我想向它添加工具提示,以阐明此按钮的位置。如何在活动管理员中添加工具提示。
下面是我定义 actionitem 的代码,我想在此处添加工具提示以提供有关此 action item 的一些信息。
action_item only: :index do
def permitted_params
params.permit(:q => [:gender_eq , :date_of_birth_gteq , :date_of_birth_lteq , :relationship_status_id_eq,:occupation_id_eq, :qualification_id_eq ,:monthly_income_id_eq ,:common_interests_interest_id_eq , :location_id_eq, :number_of_people_at_home_eq ,:area_eq, :transport_id_eq , :like_count_in , :view_count_in , :view_greater_in , :like_greater_in])
end
if !params[:q].nil?
filter_user=User.search(params[:q])
if filter_user.result.count > 0
p=PsychographicsFilter.create(permitted_params["q"])
session[:last_update]=p.id
session[:associated_user_ids]=filter_user.result.map(&:id)
link_to "Ask Question", new_admin_psychographics_question_path(:post => { :filter_id => session[:last_update] , :users => session[:associated_user_ids]})
end
end
结束
您可以在操作上添加工具提示,就像通常我们可以在 rails
中添加 link_to
action_item :my_new_action, only: :index do
link_to 'Action Name', path_of_the_action, {title: "My Tooltip"}
end
对于你的问题只需更改此
link_to "Ask Question", new_admin_psychographics_question_path(:post => { :filter_id => session[:last_update] , :users => session[:associated_user_ids]})
到
link_to "Ask Question", new_admin_psychographics_question_path(:post => { :filter_id => session[:last_update] , :users => session[:associated_user_ids]}), {title: "My Tooltip"}
在我的应用程序的管理门户中,我添加了操作项,点击它打开了新资源。我想向它添加工具提示,以阐明此按钮的位置。如何在活动管理员中添加工具提示。
下面是我定义 actionitem 的代码,我想在此处添加工具提示以提供有关此 action item 的一些信息。
action_item only: :index do
def permitted_params
params.permit(:q => [:gender_eq , :date_of_birth_gteq , :date_of_birth_lteq , :relationship_status_id_eq,:occupation_id_eq, :qualification_id_eq ,:monthly_income_id_eq ,:common_interests_interest_id_eq , :location_id_eq, :number_of_people_at_home_eq ,:area_eq, :transport_id_eq , :like_count_in , :view_count_in , :view_greater_in , :like_greater_in])
end
if !params[:q].nil?
filter_user=User.search(params[:q])
if filter_user.result.count > 0
p=PsychographicsFilter.create(permitted_params["q"])
session[:last_update]=p.id
session[:associated_user_ids]=filter_user.result.map(&:id)
link_to "Ask Question", new_admin_psychographics_question_path(:post => { :filter_id => session[:last_update] , :users => session[:associated_user_ids]})
end
end
结束
您可以在操作上添加工具提示,就像通常我们可以在 rails
中添加 link_to action_item :my_new_action, only: :index do
link_to 'Action Name', path_of_the_action, {title: "My Tooltip"}
end
对于你的问题只需更改此
link_to "Ask Question", new_admin_psychographics_question_path(:post => { :filter_id => session[:last_update] , :users => session[:associated_user_ids]})
到
link_to "Ask Question", new_admin_psychographics_question_path(:post => { :filter_id => session[:last_update] , :users => session[:associated_user_ids]}), {title: "My Tooltip"}