we_bridge_rails_engine_nations 0.1.0
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +7 -0
- data/.gitignore +8 -0
- data/.rspec +2 -0
- data/.travis.yml +4 -0
- data/CODE_OF_CONDUCT.md +13 -0
- data/Gemfile +34 -0
- data/Gemfile.lock +254 -0
- data/LICENSE.txt +21 -0
- data/MIT-LICENSE +20 -0
- data/README.md +41 -0
- data/Rakefile +37 -0
- data/app/assets/javascripts/areas.js +2 -0
- data/app/assets/javascripts/currencies.js +2 -0
- data/app/assets/javascripts/nations.js +2 -0
- data/app/assets/javascripts/regions.js +2 -0
- data/app/assets/stylesheets/areas.css +4 -0
- data/app/assets/stylesheets/currencies.css +4 -0
- data/app/assets/stylesheets/nations.css +4 -0
- data/app/assets/stylesheets/regions.css +4 -0
- data/app/assets/stylesheets/scaffold.css +56 -0
- data/app/controllers/areas_controller.rb +7 -0
- data/app/controllers/currencies_controller.rb +58 -0
- data/app/controllers/nations_controller.rb +7 -0
- data/app/controllers/regions_controller.rb +7 -0
- data/app/helpers/areas_helper.rb +2 -0
- data/app/helpers/currencies_helper.rb +2 -0
- data/app/helpers/nations_helper.rb +2 -0
- data/app/helpers/regions_helper.rb +2 -0
- data/app/mailers/.keep +0 -0
- data/app/models/.keep +0 -0
- data/app/models/area.rb +14 -0
- data/app/models/area_text.rb +7 -0
- data/app/models/currency.rb +26 -0
- data/app/models/currency_nation_map.rb +4 -0
- data/app/models/currency_text.rb +7 -0
- data/app/models/nation.rb +45 -0
- data/app/models/nation_text.rb +7 -0
- data/app/models/region.rb +15 -0
- data/app/models/region_text.rb +7 -0
- data/app/views/.keep +0 -0
- data/app/views/areas/edit.html.builder +1 -0
- data/app/views/areas/index.html.builder +1 -0
- data/app/views/areas/new.html.builder +1 -0
- data/app/views/areas/show.html.builder +1 -0
- data/app/views/currencies/_form.html.builder +14 -0
- data/app/views/currencies/edit.html.builder +7 -0
- data/app/views/currencies/index.html.builder +25 -0
- data/app/views/currencies/new.html.builder +5 -0
- data/app/views/currencies/show.html.builder +8 -0
- data/app/views/nations/edit.html.builder +1 -0
- data/app/views/nations/index.html.builder +1 -0
- data/app/views/nations/new.html.builder +1 -0
- data/app/views/nations/show.html.builder +1 -0
- data/app/views/regions/edit.html.builder +1 -0
- data/app/views/regions/index.html.builder +1 -0
- data/app/views/regions/new.html.builder +1 -0
- data/app/views/regions/show.html.builder +1 -0
- data/bin/console +14 -0
- data/bin/rails +12 -0
- data/bin/setup +7 -0
- data/config/routes.rb +6 -0
- data/db/migrate/20151127040229_create_nations.rb +27 -0
- data/db/migrate/20151127040410_create_regions.rb +19 -0
- data/db/migrate/20151127040435_create_areas.rb +19 -0
- data/db/migrate/20151202041711_create_currencies.rb +28 -0
- data/db/seeds.rb +439 -0
- data/lib/tasks/we_bridge_rails_engine_nations_tasks.rake +4 -0
- data/lib/we_bridge_rails_engine_nations.rb +7 -0
- data/lib/we_bridge_rails_engine_nations/engine.rb +24 -0
- data/lib/we_bridge_rails_engine_nations/version.rb +3 -0
- data/spec/controllers/areas_controller_spec.rb +169 -0
- data/spec/controllers/currencies_controller_spec.rb +159 -0
- data/spec/controllers/nations_controller_spec.rb +169 -0
- data/spec/controllers/regions_controller_spec.rb +169 -0
- data/spec/dummy/README.rdoc +28 -0
- data/spec/dummy/Rakefile +6 -0
- data/spec/dummy/app/assets/javascripts/application.js +16 -0
- data/spec/dummy/app/assets/stylesheets/application.css +15 -0
- data/spec/dummy/app/controllers/application_controller.rb +8 -0
- data/spec/dummy/app/helpers/application_helper.rb +2 -0
- data/spec/dummy/app/views/layouts/application.html.builder +14 -0
- data/spec/dummy/bin/bundle +3 -0
- data/spec/dummy/bin/rails +4 -0
- data/spec/dummy/bin/rake +4 -0
- data/spec/dummy/bin/setup +29 -0
- data/spec/dummy/config.ru +4 -0
- data/spec/dummy/config/application.rb +28 -0
- data/spec/dummy/config/boot.rb +5 -0
- data/spec/dummy/config/database.yml +25 -0
- data/spec/dummy/config/environment.rb +5 -0
- data/spec/dummy/config/environments/development.rb +41 -0
- data/spec/dummy/config/environments/production.rb +79 -0
- data/spec/dummy/config/environments/test.rb +42 -0
- data/spec/dummy/config/initializers/assets.rb +11 -0
- data/spec/dummy/config/initializers/backtrace_silencers.rb +7 -0
- data/spec/dummy/config/initializers/cookies_serializer.rb +3 -0
- data/spec/dummy/config/initializers/filter_parameter_logging.rb +4 -0
- data/spec/dummy/config/initializers/inflections.rb +16 -0
- data/spec/dummy/config/initializers/mime_types.rb +4 -0
- data/spec/dummy/config/initializers/provider_settings.rb +2 -0
- data/spec/dummy/config/initializers/session_store.rb +3 -0
- data/spec/dummy/config/initializers/wrap_parameters.rb +14 -0
- data/spec/dummy/config/locales/en.yml +23 -0
- data/spec/dummy/config/omniauth.yml +63 -0
- data/spec/dummy/config/omniauth.yml.org +63 -0
- data/spec/dummy/config/routes.rb +56 -0
- data/spec/dummy/config/secrets.yml +22 -0
- data/spec/dummy/db/development.sqlite3 +0 -0
- data/spec/dummy/db/schema.rb +221 -0
- data/spec/dummy/db/test.sqlite3 +0 -0
- data/spec/dummy/log/development.log +46295 -0
- data/spec/dummy/log/test.log +678 -0
- data/spec/dummy/public/404.html +67 -0
- data/spec/dummy/public/422.html +67 -0
- data/spec/dummy/public/500.html +66 -0
- data/spec/dummy/public/favicon.ico +0 -0
- data/spec/dummy/tmp/cache/assets/development/sprockets/v3.0/3qWp1cfMUMB1L1B8w4KCdPJNoktDLzCgZhyGa-eLd0g.cache +1 -0
- data/spec/dummy/tmp/cache/assets/development/sprockets/v3.0/5Lly_CA8DZvPhQV2jDQx-Y6P_y3Ygra9t5jfSlGhHDA.cache +2 -0
- data/spec/dummy/tmp/cache/assets/development/sprockets/v3.0/6VfBYgqqzYcjALfLCOpHzv3E06n_zzoM0lDBI4rnsx0.cache +0 -0
- data/spec/dummy/tmp/cache/assets/development/sprockets/v3.0/6vg_COhVhYBSY6arqzRJFOy9-rF95BfYQsFuol_UGuQ.cache +1 -0
- data/spec/dummy/tmp/cache/assets/development/sprockets/v3.0/Azqp0lWcLN5Iz5BDrWrNLqHomPvFzn6pENzB3pm95wo.cache +2 -0
- data/spec/dummy/tmp/cache/assets/development/sprockets/v3.0/GYvDs3EBryNSEN-M5uVb3LOFo1oBWq0iDPijDjBVvUs.cache +1 -0
- data/spec/dummy/tmp/cache/assets/development/sprockets/v3.0/H0uxW1DRyYygsm_fv_sMfVycqsGCazsfNJhSZU81CFY.cache +0 -0
- data/spec/dummy/tmp/cache/assets/development/sprockets/v3.0/HcVN18DR0_BmshzEZLPjkeVDruXBZ9iXjboBWmO6Ozw.cache +1 -0
- data/spec/dummy/tmp/cache/assets/development/sprockets/v3.0/JigkThideDLksj6ZrufTx6bLVyJBmNDbaouRbMbZdIA.cache +2 -0
- data/spec/dummy/tmp/cache/assets/development/sprockets/v3.0/N2BTDMKiaaZ5__Eeqks0aWBzX-5T9Hg0d0015KmSRQo.cache +1 -0
- data/spec/dummy/tmp/cache/assets/development/sprockets/v3.0/NrdOdaS5o4trMDBP6UBqLzFsRrmSPy7XJBBtdwktXqk.cache +1 -0
- data/spec/dummy/tmp/cache/assets/development/sprockets/v3.0/OI6uxGcnsKavdWTtwDAasU3wPx8QXhzBgV0X2n1KjMQ.cache +3 -0
- data/spec/dummy/tmp/cache/assets/development/sprockets/v3.0/bUQg5IzV2hJHu0Ua4jOdDcbaLqfzpRqx6-qq9C23sts.cache +0 -0
- data/spec/dummy/tmp/cache/assets/development/sprockets/v3.0/boUHvgQlz503FXEZntk5rEF6Z0dNUvT4VOQquML62dQ.cache +1 -0
- data/spec/dummy/tmp/cache/assets/development/sprockets/v3.0/g5LtU2jYJLiGyWluzwkSuH9dRStTuMGHLO-ivn8wCYE.cache +0 -0
- data/spec/dummy/tmp/cache/assets/development/sprockets/v3.0/gOWNSsYT5GN_cqGVL1MK1faY9XglwixonQVkDk9Pkvk.cache +0 -0
- data/spec/dummy/tmp/cache/assets/development/sprockets/v3.0/h-W0KoQGAiH7Sn5Y6HjTaVkoEceKV_LeymnmENnyLYQ.cache +0 -0
- data/spec/dummy/tmp/cache/assets/development/sprockets/v3.0/n5wUjw8Ag9zP7pgTsene8E7Lj3RyWbqUaf2apVdzwc0.cache +2 -0
- data/spec/dummy/tmp/cache/assets/development/sprockets/v3.0/nYdpABG_YyXwDqCH1vBNjh0m2AlewuKD9vT92xFu9Qs.cache +1 -0
- data/spec/dummy/tmp/cache/assets/development/sprockets/v3.0/nrXgDez-J-7C7rQSEpAiK0Xj5rK37sysOLNYmJIsb_Q.cache +1 -0
- data/spec/dummy/tmp/cache/assets/development/sprockets/v3.0/r_WSE-C4C32WlhZaTBsdC4x3Mf7EQQ93zBA3xOKSw94.cache +1 -0
- data/spec/dummy/tmp/cache/assets/development/sprockets/v3.0/s7AiRxV9LdOVAylAE38RiKCstOIGXxlkhZ15nV8_GfY.cache +2 -0
- data/spec/dummy/tmp/cache/assets/development/sprockets/v3.0/tXQLPTRHFdkPsB5bF6KRKGiUir3uMwdTnxE0na0vmes.cache +0 -0
- data/spec/dummy/tmp/cache/assets/development/sprockets/v3.0/vTbuVbqVUHIvOo23rSZvO1yTT8C-98lLVXe_JG_6Pr8.cache +1 -0
- data/spec/dummy/tmp/cache/assets/development/sprockets/v3.0/x22RvUd8k76gbEMX05JmfJaBplbMc2omvEoreS8eAqg.cache +1 -0
- data/spec/dummy/tmp/cache/assets/development/sprockets/v3.0/xQIYU3iVajL0UcrfbxTB8PIxGMuRDRvRjmq0ve9-s9U.cache +2 -0
- data/spec/factories/areas.rb +6 -0
- data/spec/factories/currencies.rb +6 -0
- data/spec/factories/nations.rb +6 -0
- data/spec/factories/regions.rb +6 -0
- data/spec/helpers/areas_helper_spec.rb +15 -0
- data/spec/helpers/currencies_helper_spec.rb +15 -0
- data/spec/helpers/nations_helper_spec.rb +15 -0
- data/spec/helpers/regions_helper_spec.rb +15 -0
- data/spec/models/area_spec.rb +5 -0
- data/spec/models/currency_spec.rb +24 -0
- data/spec/models/nation_spec.rb +24 -0
- data/spec/models/region_spec.rb +5 -0
- data/spec/rails_helper.rb +54 -0
- data/spec/routing/areas_routing_spec.rb +39 -0
- data/spec/routing/currencies_routing_spec.rb +39 -0
- data/spec/routing/nations_routing_spec.rb +39 -0
- data/spec/routing/regions_routing_spec.rb +39 -0
- data/spec/spec_helper.rb +2 -0
- data/spec/views/areas/edit.html.builder_spec.rb +14 -0
- data/spec/views/areas/index.html.builder_spec.rb +14 -0
- data/spec/views/areas/new.html.builder_spec.rb +14 -0
- data/spec/views/areas/show.html.builder_spec.rb +11 -0
- data/spec/views/currencies/edit.html.builder_spec.rb +14 -0
- data/spec/views/currencies/index.html.builder_spec.rb +14 -0
- data/spec/views/currencies/new.html.builder_spec.rb +14 -0
- data/spec/views/currencies/show.html.builder_spec.rb +11 -0
- data/spec/views/nations/edit.html.builder_spec.rb +14 -0
- data/spec/views/nations/index.html.builder_spec.rb +14 -0
- data/spec/views/nations/new.html.builder_spec.rb +14 -0
- data/spec/views/nations/show.html.builder_spec.rb +11 -0
- data/spec/views/regions/edit.html.builder_spec.rb +14 -0
- data/spec/views/regions/index.html.builder_spec.rb +14 -0
- data/spec/views/regions/new.html.builder_spec.rb +14 -0
- data/spec/views/regions/show.html.builder_spec.rb +11 -0
- data/spec/we_bridge_rails_engine_nations_spec.rb +7 -0
- data/we_bridge_rails_engine_nations.gemspec +42 -0
- metadata +482 -0
@@ -0,0 +1,56 @@
|
|
1
|
+
body { background-color: #fff; color: #333; }
|
2
|
+
|
3
|
+
body, p, ol, ul, td {
|
4
|
+
font-family: verdana, arial, helvetica, sans-serif;
|
5
|
+
font-size: 13px;
|
6
|
+
line-height: 18px;
|
7
|
+
}
|
8
|
+
|
9
|
+
pre {
|
10
|
+
background-color: #eee;
|
11
|
+
padding: 10px;
|
12
|
+
font-size: 11px;
|
13
|
+
}
|
14
|
+
|
15
|
+
a { color: #000; }
|
16
|
+
a:visited { color: #666; }
|
17
|
+
a:hover { color: #fff; background-color:#000; }
|
18
|
+
|
19
|
+
div.field, div.actions {
|
20
|
+
margin-bottom: 10px;
|
21
|
+
}
|
22
|
+
|
23
|
+
#notice {
|
24
|
+
color: green;
|
25
|
+
}
|
26
|
+
|
27
|
+
.field_with_errors {
|
28
|
+
padding: 2px;
|
29
|
+
background-color: red;
|
30
|
+
display: table;
|
31
|
+
}
|
32
|
+
|
33
|
+
#error_explanation {
|
34
|
+
width: 450px;
|
35
|
+
border: 2px solid red;
|
36
|
+
padding: 7px;
|
37
|
+
padding-bottom: 0;
|
38
|
+
margin-bottom: 20px;
|
39
|
+
background-color: #f0f0f0;
|
40
|
+
}
|
41
|
+
|
42
|
+
#error_explanation h2 {
|
43
|
+
text-align: left;
|
44
|
+
font-weight: bold;
|
45
|
+
padding: 5px 5px 5px 15px;
|
46
|
+
font-size: 12px;
|
47
|
+
margin: -7px;
|
48
|
+
margin-bottom: 0px;
|
49
|
+
background-color: #c00;
|
50
|
+
color: #fff;
|
51
|
+
}
|
52
|
+
|
53
|
+
#error_explanation ul li {
|
54
|
+
font-size: 12px;
|
55
|
+
list-style: square;
|
56
|
+
}
|
@@ -0,0 +1,58 @@
|
|
1
|
+
class CurrenciesController < ApplicationController
|
2
|
+
before_action :set_currency, only: [:show, :edit, :update, :destroy]
|
3
|
+
|
4
|
+
# GET /currencies
|
5
|
+
def index
|
6
|
+
@currencies = Currency.all
|
7
|
+
end
|
8
|
+
|
9
|
+
# GET /currencies/1
|
10
|
+
def show
|
11
|
+
end
|
12
|
+
|
13
|
+
# GET /currencies/new
|
14
|
+
def new
|
15
|
+
@currency = Currency.new
|
16
|
+
end
|
17
|
+
|
18
|
+
# GET /currencies/1/edit
|
19
|
+
def edit
|
20
|
+
end
|
21
|
+
|
22
|
+
# POST /currencies
|
23
|
+
def create
|
24
|
+
@currency = Currency.new(currency_params)
|
25
|
+
|
26
|
+
if @currency.save
|
27
|
+
redirect_to @currency, notice: 'Currency was successfully created.'
|
28
|
+
else
|
29
|
+
render :new
|
30
|
+
end
|
31
|
+
end
|
32
|
+
|
33
|
+
# PATCH/PUT /currencies/1
|
34
|
+
def update
|
35
|
+
if @currency.update(currency_params)
|
36
|
+
redirect_to @currency, notice: 'Currency was successfully updated.'
|
37
|
+
else
|
38
|
+
render :edit
|
39
|
+
end
|
40
|
+
end
|
41
|
+
|
42
|
+
# DELETE /currencies/1
|
43
|
+
def destroy
|
44
|
+
@currency.destroy
|
45
|
+
redirect_to currencies_url, notice: 'Currency was successfully destroyed.'
|
46
|
+
end
|
47
|
+
|
48
|
+
private
|
49
|
+
# Use callbacks to share common setup or constraints between actions.
|
50
|
+
def set_currency
|
51
|
+
@currency = Currency.find(params[:id])
|
52
|
+
end
|
53
|
+
|
54
|
+
# Only allow a trusted parameter "white list" through.
|
55
|
+
def currency_params
|
56
|
+
params[:currency]
|
57
|
+
end
|
58
|
+
end
|
data/app/mailers/.keep
ADDED
File without changes
|
data/app/models/.keep
ADDED
File without changes
|
data/app/models/area.rb
ADDED
@@ -0,0 +1,14 @@
|
|
1
|
+
require 'action_view/helpers/auto_tag_helper/form_info'
|
2
|
+
require 'activerecord/mlang'
|
3
|
+
class Area < ActiveRecord::Base
|
4
|
+
include ActiveRecord::Mlang
|
5
|
+
include ActionView::Helpers::AutoTagHelper::FormInfo
|
6
|
+
set_accessible_attrs :name
|
7
|
+
validates :name, presence: true
|
8
|
+
def __display__
|
9
|
+
self.name
|
10
|
+
end
|
11
|
+
# set_input_options :email, type: :email
|
12
|
+
# set_input_options :url, type: :url
|
13
|
+
# set_input_options :tel, type: :phone
|
14
|
+
end
|
@@ -0,0 +1,26 @@
|
|
1
|
+
require 'action_view/helpers/auto_tag_helper/form_info'
|
2
|
+
require 'activerecord/mlang'
|
3
|
+
class Currency < ActiveRecord::Base
|
4
|
+
has_many :currency_nation_maps
|
5
|
+
has_many :nations, through: :currency_nation_maps
|
6
|
+
|
7
|
+
include ActiveRecord::Mlang
|
8
|
+
include ActionView::Helpers::AutoTagHelper::FormInfo
|
9
|
+
set_accessible_attrs :name, :iso_code
|
10
|
+
validates :iso_code, length: { maximum: self.columns_hash['iso_code'].limit }, presence: false
|
11
|
+
def __display__
|
12
|
+
self.name
|
13
|
+
end
|
14
|
+
|
15
|
+
def self.[](iso_code)
|
16
|
+
self.find_by(iso_code: iso_code.to_s.strip)
|
17
|
+
end
|
18
|
+
|
19
|
+
def add_nation(code)
|
20
|
+
if nid = Nation[code].try(:id)
|
21
|
+
CurrencyNationMap.find_or_create_by(currency_id: self.id, nation_id: nid)
|
22
|
+
else
|
23
|
+
nil
|
24
|
+
end
|
25
|
+
end
|
26
|
+
end
|
@@ -0,0 +1,45 @@
|
|
1
|
+
require 'action_view/helpers/auto_tag_helper/form_info'
|
2
|
+
require 'activerecord/mlang'
|
3
|
+
class Nation < ActiveRecord::Base
|
4
|
+
has_many :currency_nation_maps
|
5
|
+
has_many :currencies, through: :currency_nation_maps
|
6
|
+
belongs_to :region
|
7
|
+
include ActiveRecord::Mlang
|
8
|
+
include ActionView::Helpers::AutoTagHelper::FormInfo
|
9
|
+
set_accessible_attrs :region_id, :name, :code_alpha2, :code_alpha3, :code_numeric, :lat, :lon
|
10
|
+
validates :name, presence: true
|
11
|
+
len2 = self.columns_hash['code_alpha2'].limit
|
12
|
+
validates :code_alpha2, length: { maximum: len2 }, presence: false
|
13
|
+
len3 = self.columns_hash['code_alpha3'].limit
|
14
|
+
validates :code_alpha3, length: { maximum: len3 }, presence: false
|
15
|
+
|
16
|
+
latlon = {numericality: { less_than_or_equal_to: 180.0, greater_than_or_equal_to: -180.0 }, allow_nil: true}
|
17
|
+
validates :lat, latlon
|
18
|
+
validates :lon, latlon
|
19
|
+
|
20
|
+
def __display__
|
21
|
+
self.name
|
22
|
+
end
|
23
|
+
|
24
|
+
def self.[](code_or_num)
|
25
|
+
col = :code_alpha2
|
26
|
+
if code_or_num.kind_of?(Numeric)
|
27
|
+
col = :code_numeric
|
28
|
+
else
|
29
|
+
col = :code_alpha3 if code_or_num.to_s.strip.size == 3
|
30
|
+
end
|
31
|
+
self.find_by(col => code_or_num)
|
32
|
+
end
|
33
|
+
|
34
|
+
def add_currency(code)
|
35
|
+
if cid = Currency[code].try(:id)
|
36
|
+
CurrencyNationMap.find_or_create_by(nation_id: self.id, currency_id: cid)
|
37
|
+
else
|
38
|
+
nil
|
39
|
+
end
|
40
|
+
end
|
41
|
+
|
42
|
+
# set_input_options :email, type: :email
|
43
|
+
# set_input_options :url, type: :url
|
44
|
+
# set_input_options :tel, type: :phone
|
45
|
+
end
|
@@ -0,0 +1,15 @@
|
|
1
|
+
require 'action_view/helpers/auto_tag_helper/form_info'
|
2
|
+
require 'activerecord/mlang'
|
3
|
+
class Region < ActiveRecord::Base
|
4
|
+
belongs_to :area
|
5
|
+
include ActiveRecord::Mlang
|
6
|
+
include ActionView::Helpers::AutoTagHelper::FormInfo
|
7
|
+
set_accessible_attrs :area_id, :name
|
8
|
+
validates :name, presence: true
|
9
|
+
def __display__
|
10
|
+
self.name
|
11
|
+
end
|
12
|
+
# set_input_options :email, type: :email
|
13
|
+
# set_input_options :url, type: :url
|
14
|
+
# set_input_options :tel, type: :phone
|
15
|
+
end
|
data/app/views/.keep
ADDED
File without changes
|
@@ -0,0 +1 @@
|
|
1
|
+
edit_common @record, area_path(id: @record), back_path: areas_path, show_path: area_path(id: @record)
|
@@ -0,0 +1 @@
|
|
1
|
+
index_common(@records, show_path: ->(record){ area_path(id: record.id)}, edit_path: ->(record){ edit_area_path(record) }, new_path: new_area_path )
|
@@ -0,0 +1 @@
|
|
1
|
+
new_common(@record, areas_path, back_path: areas_path)
|
@@ -0,0 +1 @@
|
|
1
|
+
show_common @record, show_path: area_path(id: @record), back_path: areas_path, edit_path: edit_area_path(id: @record)
|
@@ -0,0 +1,14 @@
|
|
1
|
+
form_for @currency do |f|
|
2
|
+
markup{|m|
|
3
|
+
if @currency.errors.any?
|
4
|
+
#error_explanation
|
5
|
+
m.h2 "#{pluralize(@currency.errors.count, "error")} prohibited this currency from being saved:"
|
6
|
+
m.ul do
|
7
|
+
@currency.errors.full_messages.each do |message|
|
8
|
+
m.li message
|
9
|
+
end
|
10
|
+
end
|
11
|
+
end
|
12
|
+
m << f.submit
|
13
|
+
}.html_safe
|
14
|
+
end
|
@@ -0,0 +1,25 @@
|
|
1
|
+
markup do |m|
|
2
|
+
m.h1 'Listing currencies'
|
3
|
+
m.table do
|
4
|
+
m.thead do
|
5
|
+
m.tr do
|
6
|
+
m.th
|
7
|
+
m.th
|
8
|
+
m.th
|
9
|
+
end
|
10
|
+
end
|
11
|
+
m.tbody do
|
12
|
+
@currencies.each do |currency|
|
13
|
+
m.tr do
|
14
|
+
m.td { m << link_to('Show', 'currency') }
|
15
|
+
m.td { m << link_to('Edit', edit_currency_path(currency)) }
|
16
|
+
m.td { m << link_to('Destroy', currency, data: { confirm: 'Are you sure?' }, method: :delete) }
|
17
|
+
end
|
18
|
+
end
|
19
|
+
end
|
20
|
+
end
|
21
|
+
|
22
|
+
m.br
|
23
|
+
m << link_to('New Currency', new_currency_path)
|
24
|
+
|
25
|
+
end
|