これは IE8 のみの問題です。Firefox、Chrome、Safari、さらには IE9 でも問題なく動作します。とにかく、アプリのログイン ページに、巨大な灰色のボタンのようにスタイル設定した div があります。コードは次のとおりです。
.user_form .submit input[type=submit] {
display: block;
width: 100%;
height: 55px;
text-align: left;
margin-bottom: 0;
padding: 0 11px;
color: #fff;
font-size: 16px;
font-weight: bold;
line-height: 25px;
text-shadow: -1px -1px 1px rgba(0,0,0, 0.25);
text-transform: uppercase;
background: #4a5a64 url(/images/h1_background.gif) repeat-x;
border: none;
}
そして、これがhamlコードです:
.submit
= submit_tag 'Sign in', :class => 'no_style', :type => 'submit'
これは IE8 を除くすべてのブラウザで正常に動作するため、これをボタンに変換せずに修正する方法があるかどうか、つまり、haml で次のようにする方法があるかどうか疑問に思っていました。
.submit
%button.submit_tag { bla bla bla } Sign In
ありがとうございました!
更新: ログイン ページ全体のすべての Haml コードを次に示します。前述したように、Firefox、Chrome、および IE9 では、ユーザー名とパスワードを入力して Enter キーを押すと、ウェルカム ページに進みます (もちろん、ユーザー名とパスワードが正しいことが前提です)。ただし、IE8 では、ビープ音が鳴るだけで、ページにとどまります。
- content_for :trackers do
= google_analytics_standard_page_tracker
= salesforce_tracker
- title 'Sign In', false
- form_for :session, :url => session_path, :html => { :class => 'user_form' } do |f|
.field
= f.label :email, 'Username'
= f.text_field :email, :maxlength => 255, :autofocus => true
.field
= f.label :password
= f.password_field :password
.submit
%input{ :type => 'submit', :value => 'Sign in' }
.section.right
%ul.links
%li= link_to 'Forgot password?', new_password_path
%li= link_to 'Don\'t have an account? Sign up now', marketing_site_url("/index.php/buy-now")
%li= link_to 'Resend activation email', resend_activation_path
= render 'shared/need_help'