Ruby on rails 3 锚定和精炼cms菜单子uri的路由错误
我已经开发了RubyonRails应用程序,并试图通过引用本文使用ApachePassenger子uri来部署它。图像、css和Java脚本都可以正常工作。但是锚定标签和其他菜单标签不起作用 我的锚标签代码是Ruby on rails 3 锚定和精炼cms菜单子uri的路由错误,ruby-on-rails-3,apache2,passenger,refinerycms,Ruby On Rails 3,Apache2,Passenger,Refinerycms,我已经开发了RubyonRails应用程序,并试图通过引用本文使用ApachePassenger子uri来部署它。图像、css和Java脚本都可以正常工作。但是锚定标签和其他菜单标签不起作用 我的锚标签代码是 <a href=<%= "#{request.env['HTTP-HOST']}/product_details/gotoLink/#{p1}/#{p2}" %> target="_blank" id="zoomid"></a> 我已在“/admi
<a href=<%= "#{request.env['HTTP-HOST']}/product_details/gotoLink/#{p1}/#{p2}" %> target="_blank" id="zoomid"></a>
我已在“/admin”上安装了cms。当我使用访问它时,它将成功登录,但当我单击页面、文件等菜单时,我将得到404错误
没有子uri,同样的应用程序也可以正常工作。请任何人帮我解决这个问题
提前感谢我引用了此url,并通过执行以下更改解决了此问题
我这样解决了第一个问题
rake RAILS_RELATIVE_URL_ROOT=/suburi assets:precompile RAILS_ENV=production
<a href=<%= "#{request.env['HTTP-HOST']}#{ENV['RAILS_RELATIVE_URL_ROOT']}/product_details/#{p1}/#{p2}" %> target="_blank" id="zoomid" >Link Name</a>
RAILSapp->config->environments->production.rb
config.action_controller.relative_url_root = ENV['RAILS_RELATIVE_URL_ROOT']
在我看来,我确实喜欢这样
rake RAILS_RELATIVE_URL_ROOT=/suburi assets:precompile RAILS_ENV=production
<a href=<%= "#{request.env['HTTP-HOST']}#{ENV['RAILS_RELATIVE_URL_ROOT']}/product_details/#{p1}/#{p2}" %> target="_blank" id="zoomid" >Link Name</a>
对于炼油厂,我添加了应用程序->视图->炼油厂->管理->\u menu.html.erb
<%= link_to plugin.title, refinery.url_for("#{ENV['RAILS_RELATIVE_URL_ROOT']}#{plugin.url}"),:class => ("active" if plugin.highlighted?(params)),:id => "plugin_#{plugin.name}" %>
(“active”if plugin.highlighted?(params)),:id=>“plugin#{plugin.name}”%>
和应用程序内->视图->炼油厂->站点\u bar.html.erb
<%= link_to "Home", "#{ENV['RAILS_RELATIVE_URL_ROOT']}" -%>
我的问题已经解决了。如果这不是正确的方法,那么请告诉我正确的方法
谢谢我引用了此url,通过执行以下更改,问题得到了解决
我这样解决了第一个问题
rake RAILS_RELATIVE_URL_ROOT=/suburi assets:precompile RAILS_ENV=production
<a href=<%= "#{request.env['HTTP-HOST']}#{ENV['RAILS_RELATIVE_URL_ROOT']}/product_details/#{p1}/#{p2}" %> target="_blank" id="zoomid" >Link Name</a>
RAILSapp->config->environments->production.rb
config.action_controller.relative_url_root = ENV['RAILS_RELATIVE_URL_ROOT']
在我看来,我确实喜欢这样
rake RAILS_RELATIVE_URL_ROOT=/suburi assets:precompile RAILS_ENV=production
<a href=<%= "#{request.env['HTTP-HOST']}#{ENV['RAILS_RELATIVE_URL_ROOT']}/product_details/#{p1}/#{p2}" %> target="_blank" id="zoomid" >Link Name</a>
对于炼油厂,我添加了应用程序->视图->炼油厂->管理->\u menu.html.erb
<%= link_to plugin.title, refinery.url_for("#{ENV['RAILS_RELATIVE_URL_ROOT']}#{plugin.url}"),:class => ("active" if plugin.highlighted?(params)),:id => "plugin_#{plugin.name}" %>
(“active”if plugin.highlighted?(params)),:id=>“plugin#{plugin.name}”%>
和应用程序内->视图->炼油厂->站点\u bar.html.erb
<%= link_to "Home", "#{ENV['RAILS_RELATIVE_URL_ROOT']}" -%>
我的问题已经解决了。如果这不是正确的方法,那么请告诉我正确的方法
谢谢