我正在试试railscasts第213集的教程日历.我添加es.yml但没有工作.我尝试使用en.yml上的替换单词本地化月份名称,例如
en:
date:
month_names: [~, Enero, Febrero, Marzo, Abril, Mayo, Junio, Julio, Agosto, Septiembre, Octubre, Noviembre, Diciembre]
abbr_month_names: [~, Ene, Feb, Mar, Abr, May, Jun, Jul, Ago, Sep, Oct, Nov, Dic]
Run Code Online (Sandbox Code Playgroud)
不工作
在html.erb上
<h2 id="month"><%= @date.strftime("%B %Y") %></h2>
Run Code Online (Sandbox Code Playgroud)
我想改变这个

有人帮我吗?
谢谢
I want change tabs on opencart (admin view) with twitter bootstrap 3.0, the code following :
<ul id="myTab" class="nav nav-tabs">
<li class="active"><a href="#tab-general" data-toggle="tab"><?php echo $tab_general; ?></a></li>
<li class=""><a href="#tab-data" data-toggle="tab"><?php echo $tab_data; ?></a></li>
<li class=""><a href="#tab-design" data-toggle="tab"><?php echo $tab_design; ?></a></li>
</ul>
<div id="myTabContent" class="tab-content">
<div id="tab-general" class="tab-pane fade active in">
<ul id="languages" class="nav nav-tabs">
<?php $i = 0; ?>
<?php foreach ($languages as $language) { ?>
<li class="<?php if ($i == 0) { echo 'active'; } ?>">
<a …Run Code Online (Sandbox Code Playgroud) 我尝试改变页面的一些样式,我希望使用用户jQuery - css() method脚本来改变样式.
我试过jsfiddle,我的浏览器使用Tampermonkey
某些属性样式已更改但未gradient filter更改.这是页面上的风格:
#site-header .meta-header {
width: 100%;
min-width: 960px;
position: fixed;
top: 0;
left: 0;
right: 0;
height: 30px;
background-color: #1484ce;
filter: progid:DXImageTransform.Microsoft.gradient(gradientType=0, startColorstr='#FF1484CE', endColorstr='#FF1274B5');
background-image: -webkit-gradient(linear, 50% 0%, 50% 100%, color-stop(0%, #1484ce), color-stop(100%, #1274b5));
background-image: -webkit-linear-gradient(top, #1484ce 0%,#1274b5 100%);
background-image: -moz-linear-gradient(top, #1484ce 0%,#1274b5 100%);
background-image: -o-linear-gradient(top, #1484ce 0%,#1274b5 100%);
background-image: linear-gradient(top, #1484ce 0%,#1274b5 100%);
-webkit-box-shadow: 0 2px 0 #0e5a8c;
box-shadow: 0 2px 0 #0e5a8c;
border-bottom: solid 1px rgba(255,255,255,0.1); …Run Code Online (Sandbox Code Playgroud) 我使用clientidevalidations gem和twitter bootstrap-modal为我的应用程序.但是vaidations没有用.
在application.js上
//= require bootstrap-modal
Run Code Online (Sandbox Code Playgroud)
这是模态对话框中显示的元素
<div id="myModal" class="modal hide fade" tabindex="-1" role="dialog" aria-labelledby="myModalLabel" aria-hidden="true" >
<%= form_for @content, :validate => true do |f| %>
<script>$('#new_content').validate()</script>
<div class="modal-header">
<button type="button" class="close" data-dismiss="modal" aria-hidden="true">×</button>
<h3 id="myModalLabel">New Content</h3>
</div>
<div class="modal-body" style = "height:600px;overflow-y: scroll;">
<div class="field">
<%= f.label :name %><br />
<%= f.text_field :name %>
</div>
<div class="field">
<%= f.label :permalink, "Permalink" %><br />
<%= f.text_field :permalink %>
</div>
<div class="field">
<%= f.label :body %><br />
<%= f.text_area :body, …Run Code Online (Sandbox Code Playgroud) forms ruby-on-rails modal-dialog client-side-validation twitter-bootstrap
Fullcalendar非常漂亮.我试试看.我想尝试在每个事件上添加popover作为描述.如果我单击一个事件,则会显示弹出窗口.比如http://i.cubeupload.com/LuBXjx.png 我不了解json和javascript,但我想了解这一切.有人可以帮帮我吗?
Popover calendars.js.coffee
$(document).ready ->
$('#test').fullCalendar
header:
left: 'prev,next today',
center: 'title',
right: 'month'
defaultView: 'month',
height: 500,
buttonText: {
month: 'month',
today: 'today'
},
eventSources: [{
url: '/school/calendars',
}],
firstHour: 6,
slotMinutes: 30,
defaultEventMinutes: 120,
axisFormat: 'H',
timeFormat: 'H(:mm)',
dragOpacity: {
agenda: 0.5
},
minTime: 0,
maxTime: 24
Run Code Online (Sandbox Code Playgroud)
在model/event.rb上
scope :between, lambda {|start_time, end_time|
{:conditions => [
"starts_at > ? and starts_at < ?",
Event.format_date(start_time), Event.format_date(end_time)
] }
}
# need to override the json view to …Run Code Online (Sandbox Code Playgroud) javascript json ruby-on-rails fullcalendar twitter-bootstrap
我有关于postgresql的查询,我想在我的应用程序中使用rails实现
ActiveRecord::Base.connection.select_rows("SELECT to_char(date,'Mon') as mon, extract(year from date) as yyyy, SUM(CASE WHEN Title = 4 THEN Qty ELSE 0 END) AS sold FROM Transactions WHERE Store_id = 5 AND Product_id = 2 GROUP BY 1,2")
Run Code Online (Sandbox Code Playgroud)
我试过rails console,结果是:
?[1m?[36m (2.0ms)?[0m ?[1m
SELECT to_char(date,'Mon') as mon, extract(year from date) as yyyy, SUM(CASE WHEN Title = 4 THEN Qty ELSE 0 END) AS sold FROM Transactions WHERE Store_id = 5 AND Product_id = 2 GROUP BY 1,2
?[0m=> [["Jul", "2013", "113"], ["Oct", "2013", …Run Code Online (Sandbox Code Playgroud) calendar ×1
css ×1
forms ×1
fullcalendar ×1
javascript ×1
jquery ×1
json ×1
localization ×1
modal-dialog ×1
opencart ×1
php ×1
postgresql ×1
tampermonkey ×1