问题:在哪里可以为表单找到/编辑原始的css文件?
原因:i不能更改文本窗体的“宽度”,因为它们似乎被自动设置为某个值。如果原始css文件强制所有文本窗体的宽度,我想检查它。
环境:
group :assets do
gem 'sass-rails', '~> 3.2.3'
gem 'coffee-rails', '~> 3.2.1'
gem 'bootstrap-sass'
gem 'formtastic-bootstrap'如果有人知道为什么我不能改变文本表单的宽度(大小,cols属性不起作用)的直接答案,我会更感激这个答案。谢谢你的帮助!
图像:

_form.html.erb
<% @post = Post.new %>
<%= semantic_form_for @post do |f| %>
<%= f.inputs do %>
<%= f.input :name, :hint => "enter your name", :input_html => { :rows => 10, :width => 10 } %>
<%= f.input :content, :hint => "enter the content", :input_html => { :rows => 10, :width => 100000 } %>
<% end %>
<%= f.actions do %>
<%= f.action :submit, :as => :button %>
<%= f.action :cancel, :as => :link %>
<% end %><% end %></div>HTML:
<form accept-charset="UTF-8" action="/posts" class="formtastic post" id="new_post" method="post" novalidate="novalidate"><div style="margin:0;padding:0;display:inline"><input name="utf8" type="hidden" value="✓" /><input name="authenticity_token" type="hidden" value="wFcjDR0nzm2B3yl2XtUxzlQz0CWplYf2nKiq+xgDpXo=" /></div>
<fieldset class="inputs">
<div class="string input required stringish control-group" id="post_name_input"><label class=" control-label" for="post_name">Name<abbr title="required">*</abbr></label><div class="controls"><input id="post_name" maxlength="255" name="post[name]" rows="10" type="text" width="10" /><span class="help-block">enter your name</span></div></div>
<div class="text input required control-group" id="post_content_input"><label class=" control-label" for="post_content">Content<abbr title="required">*</abbr></label><div class="controls"><textarea id="post_content" name="post[content]" rows="10" width="100000"></textarea><span class="help-block">enter the content</span></div></div></fieldset>摘要:为什么会发生这种情况,在哪里可以找到formtastc.css文件?它不在“资产”文件夹中,但页面正在以某种方式加载css。
发布于 2012-11-17 09:22:49
Formtastic.css文件位于开发人员的资产中(它在gem中,所以您不能在Windows中检查它。
在这里,下面的代码引起了麻烦
/* TEXTAREA OVERRIDES
---------------------------------------------------------------------------------*/
.formtastic .text textarea {
width:72%;
}
.formtastic .text textarea[cols] {
width:auto;
max-width:72%;
}我只是通过使用类span来解决这个问题,而不是试图修复宽度。但是你可以添加你自己的css来改变宽度,在我看来,这会带来同样的结果。
<%= f.input :content, :label => 'content', :input_html => { :rows => 5, :class => 'span10' } %>https://stackoverflow.com/questions/13408747
复制相似问题