DB migrationした後にrollbackしてくれるメソッド
- add_column
- add_index
- add_timestamps
- create_table
- create_join_table
- remove_timestamps
- rename_column
- rename_index
- rename_table
上記以外は、昔のまま self.up/downで実装すること。
http://blog.jnito.com/entry/20120326/1332767292
スネークケースへ> "camel_case". camelize=> "CamelCase"
> "CamelCase".underscore=> "camel_case"
$ bundle exec rake db:schema:load
$ rake db:schema:dump
gem 'lazy_high_charts
//= require highcharts/highcharts
//= require highcharts/highcharts-more
//= require highcharts/highstock
//= require_tree .
def sellView
@categories = ["apple", "orange", "banana", "strawberry", "melon", "lemon", "peach"]
@data = [40, 10, 20, 50, 30, 10, 60]
@h = LazyHighCharts::HighChart.new("graph") do |f|
f.chart(:type => "bar")
f.title(:text => "Sample bar")
f.xAxis(:categories => @categories)
f.series(:name => "Fruits",
:data => @data)
end
end
<%= high_chart("sample", @h) %>
<script type="text/javascript"
src="https://maps.googleapis.com/maps/api/js?sensor=false">
</script>