English 中文(简体)
一些在铁路重修后不工作的路线,3.1.4 app在gin子上
原标题:Some routes not working after re-deploying rails 3.1.4 app to /suburi on nginx

我们成功地把我们的铁路3.1.4 app子放在了12.04号浮游艇上。 生产。 rb 我们确定:

RAILS_RELATIVE_URL_ROOT="/by"

我们可以 log,走到主角。 然而,根据我们的习俗观点调整的所有路线——主要菜单的手脚不可行。 这一观点的目的就是要纪念即将进入的下一个道路,并牢记如何支持(如背)。 这里是法典(相关法典)

  def view_handler
    index  = params[:index].to_i
    url = params[:url]
    if index == 1   #forword
      session[:page_step] += 1 
      session[( page  + session[:page_step].to_s).to_sym] = url
    end

    #redirect to the page by url  
    redirect_to url
  end 

这里指的是“不工作”的链接(404个未发现错误):

<%= link_to  Projects , "/view_handler?index=1&url=#{projects_path}" %>

显示的URL(不正确)。 404人未找到返回:

http://154.248.209.181/view_handler?index=1&url=/by/projects

The following is the working URL for the above (manually into):

http://154.248.209.181/by/projects

对我们来说,从头脑看,项目“寄回/逐/项目”似乎令人奇怪。 只有项目(通过游艇路线)才能返回。

Before deploying to suburi, the rails 3.1.4 app was deployed and worked fine in root directory.

我们的建立可能会有什么错误? 非常感谢。

最佳回答

The broken routes could be fixed with addition of "/by/" before view_handler. Now the link_to looks like:

<%= link_to  Projects , "/by/view_handler?index=1&url=#{projects_path}" %>

AlsoRAILS_RELATIVE_URL_ROOT="/by" was removed in production.rb. It seems no use.

问题回答

暂无回答




相关问题
rails collection_select vs. select

collection_select and select Rails helpers: Which one should I use? I can t see a difference in both ways. Both helpers take a collection and generates options tags inside a select tag. Is there a ...

SSL slowness in EC2

We ve deployed our rails app to EC2. In our setup, we have two proxies on small instances behind round-robin DNS. These run nginx load balancers for a dynamically growing and shrinking farm of web ...

Auth-code with A-Za-z0-9 to use in an URL parameter

As part of a web application I need an auth-code to pass as a URL parameter. I am currently using (in Rails) : Digest::SHA1.hexdigest((object_id + rand(255)).to_s) Which provides long strings like : ...

RubyCAS-Client question: Rails

I ve installed RubyCAS-Client version 2.1.0 as a plugin within a rails app. It s working, but I d like to remove the ?ticket= in the url. Is this possible?

activerecord has_many :through find with one sql call

I have a these 3 models: class User < ActiveRecord::Base has_many :permissions, :dependent => :destroy has_many :roles, :through => :permissions end class Permission < ActiveRecord::...

Ordering a hash to xml: Rails

I m building an xml document from a hash. The xml attributes need to be in order. How can this be accomplished? hash.to_xml

Text Editor for Ruby-on-Rails

guys which text editor is good for Rubyonrails? i m using Windows and i was using E-Texteditor but its not free n its expired now can anyone plese tell me any free texteditor? n which one is best an ...

How to get SQL queries for each user where env is production

I’m developing an application dedicated to generate statistical reports, I would like that user after saving their stat report they save sql queries too. To do that I wrote the following module: ...

热门标签