我正在写一些代码,并希望在两个输入之间有一些空间,并且<br />在Firefox中不起作用:
<input type="text" id="X_Axis" /><br />
<input type="text" id="Y_Axis" />
Run Code Online (Sandbox Code Playgroud)
无的<br />,<br/>,</br>工作.
PS我没有在任何其他浏览器中尝试过,所以它可能不是Firefox,正如我想的那样.
我正在尝试安装Heroku ToolbeltLinux Mint 15 Olivia(x86-64)
当我尝试运行标准命令在Debian机器上安装时:
wget -qO- https: //toolbelt.heroku.com/install-ubuntu.sh | SH
我明白了:
W:无法获取http://toolbelt.heroku.com/ubuntu/./Packages 302暂时移动[IP:23.21.198.2 80]
...
E:无法找到包heroku-toolbelt
我也得到了heroku.list我的回购etc/apt/sources/:
当我尝试再次添加回购时:
sudo apt-add-repository'deb http://toolbelt.herokuapp.com/ubuntu ./'
我明白了:
无法添加PPA:'无法解码JSON对象'.
在尝试添加存储库时,我似乎不是第一个在Mint 15上出现此错误的人.
我有两个div,一个嵌套在另一个,即#messagesdiv在#mainContentdiv内.该#messagesDIV应该从其父顶部0像素.一切都很好,直到我把unordered list它放入其中,然后它将整个div从整个#messagesdiv向下推几个像素.
如果我把margin-top:0px;在上ul元素,一切都很好了,但我想了ul是margin-top:10px;从它的#messages母公司.如果我把margin-top:10px;它再次推出#messages10px #mainContent.
有人可以解释为什么会发生这种情况,有人可以为此提供一个干净的解决方案吗?
谢谢,它jsfiddle是:
我正在尝试将应用程序迁移到rails 4和ruby2.
在我的模型中Product,我有这个:
attr_accessor :name, :age, :price
Run Code Online (Sandbox Code Playgroud)
我切换到:
attr_reader :name, :age, :price
Run Code Online (Sandbox Code Playgroud)
在我看来,我有这个:
%td.small
= number_with_precision(@p.get_last_usd_price.to_f, precision: 2, delimiter: ",", strip_insignificant_zeros: true)
Run Code Online (Sandbox Code Playgroud)
一切都运行良好的rails 3.2和attr_accessor.但现在我遇到了一个问题get_last_usd_price:
def get_last_usd_price
price = 0.0
puts "--------------------"
puts self.inspect #---> prints a #<product> with all the correct attributes
puts
puts self.name.inspect #---> prints nil
puts @name.inspect #---> prints nil
puts "--------------------"
# blah blah
end
Run Code Online (Sandbox Code Playgroud)
基本上,当我尝试访问它们时,所有变量都是nil,但它们被正确保存到对象实例中.
我究竟做错了什么?我怎样才能解决这个问题?
提前致谢.
编辑:控制器
def detail_product
@p = Product.find(params[:product_id]) if params[:product_id].present?
if !@p.present? then
flash[:error] …Run Code Online (Sandbox Code Playgroud) 我是网站设计的新手,并且正在处理一些代码,其中部分代码如下:
.row-fluid
- if(params[:offset].to_i>0)
= link_to t('.previous'), reports_path(offset: give_previous_page(@offset, @limit)),
{ class: 'btn btn-small btn-primary'}
- else
Run Code Online (Sandbox Code Playgroud)
一些我了解的事情,到目前为止,例如:OK,这是一个铁的代码,而不是ERB我们已经使用HAML语法和有一些Twitter的引导类,如那些.row-fluid和btn-primary它太,但我不明白的是,"-"我们看到的旁边有" if"和" else"的行.那些是什么,他们做了什么?
我尝试在视图中显示验证错误以创建新文章页面.我在文章模型中验证了检查正文和标题的存在(验证:title,:body,:presence => true).当我保留文章和标题文本框但显示"模板丢失"错误时,它不允许创建新文章,以下信息.
Missing template articles/create, application/create with {:locale=>[:en], :formats=>[:html], :handlers=>[:erb, :builder, :coffee]}. Searched in: * "F:/kuta/billi/app/views" * "C:/RailsInstaller/Ruby1.9.3/lib/ruby/gems/1.9.1/gems/twitter-bootstrap-rails-2.2.6/app/views" * "C:/RailsInstaller/Ruby1.9.3/lib/ruby/gems/1.9.1/gems/devise-2.2.3/app/views"
Run Code Online (Sandbox Code Playgroud)
我已将<%= f.error_messages%>部分放在文章的新页面中,并将gem'vynamic_form'放在gemfile中.
_form.html.erb for article/new.html.erb
<%= form_for @article, :html => { :class => '' } do |f| %>
<%= f.error_messages %>
<div>
<%= f.label :title, :style => "margin-top:10px;" %>
<div>
<%= f.text_field :title, :style => "width:730px; height:30px; border: 1px solid #66c9ee;margin-top:10px; background-color:#FFFFFF;" %>
</div>
</div>
<div>
<%= f.label :body, :class => 'control-label' %>
<%= f.text_area :body, :style => "width:730px; …Run Code Online (Sandbox Code Playgroud) 在Ruby中,我希望显示此字符串中以"a"开头的单词数: an ant hello hint how are you
css ×3
ruby ×3
html ×2
firefox ×1
haml ×1
heroku ×1
linux ×1
linux-mint ×1
validation ×1
views ×1