0

我有一个简单的“联系我们”站点,本地服务器可以正确显示。

它在视图/布局中有 application.html.haml 和一个小的页眉和页脚。这会“产生”一个带有联系我们部分的容器。

问题是,当上传到 Heroku 时,它只显示联系我们部分。没有页眉,根本没有页脚。

我确信这不是火箭科学,但无法弄清楚。

非常感谢您的帮助!

如果有帮助,这是 URL:http: //hik-offline.herokuapp.com/

路线.rb

  #force the url to work with under WWW
  constraints(:host => "hikultura.com") do
      match "(*x)" => redirect { |params, request|
        URI.parse(request.url).tap { |x| x.host = "www.hikultura.com" }.to_s
      }
  end

  # Defines all the routes under the language locale
  scope "(:locale)", :locale => /es|eu|fr|en/ do
    resources :messages
  end

  # Routes that work with no locale 
  match '/?locale=es' => 'messages#new'
  match '/?locale=eu' => 'messages#new'
  match '/?locale=fr' => 'messages#new'
  match '/?locale=en' => 'messages#new'

应用程序.html.haml

<!DOCTYPE html>


%html{:xmlns => "http://www.w3.org/1999/xhtml", :lang => "en", "xml:lang" => "en"}

  %head
    <meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
    <meta name="csrf-param" content="authenticity_token"/>
    <meta name="keywords" content="turismo pais vasco, euskal herriko, escapadas fin de semnana pais vasco, jaia, pays basque agenda, cultura euskadi, cultura pais vasco, what to do basque country, eventos euskadi, ocio pais vasco" />
    <link rel="shortcut icon" href="/favicon.ico" />
    = title :site => "HiKultura"

    = stylesheet_link_tag    "application"

    = javascript_include_tag "application"
    = csrf_meta_tags


  %body{:class => "#{controller.controller_name} container"}
    .container
      #header
        .wrap
          #logo

            - logo_tag = image_tag("hikultura_paisvasco_euskadi_jaia_cultura_small.png", :alt => "HiKultura Logo HiKultura.com", :class => "logo_size")
            = link_to logo_tag, root_path
            #slogan.capital
              =t :slogan

          #header_right
            #login
              #lang
                - [:es, :eu, :fr, :en].each do |locale|
                  %li= link_to locale, url_for(locale: locale)

      #main
        #cubo
          #formulario
            = yield
          #info
            =t :info
            %br/
            %br/
            =t :info2
            #arrow
        #message.capital
          #notice= notice

        #linea

vies/messages/new.html.haml

%h2.capital
  =t :contact_us

= form_for @message do |f|
  -if @message.errors.any?
    .error_messages
      %h2
        = pluralize(@message.errors.count, "error")
        prohibited this message from being saved:
        %ul
          - @message.errors.full_messages.each do |msg|
            %li
              = msg
  .field.capital
    = f.label t(:name)
    %br/
    = f.text_field :name, :size => 46
  .field.capital
    = f.label t :email
    %br/
    = f.email_field :email, :size => 46
  .field.capital
    = f.label :content, t(:message)
    %br/
    = f.text_area :content, :rows => 5, :width => 45
  .actions.capital.theFont
    = f.submit t(:send_message)
4

1 回答 1

0

现在都无所谓了。

我创建了一个新的 rails 项目,复制了代码并开始工作。

谢谢

于 2013-01-09T16:08:31.237 回答