ish_lib_engine 0.0.1

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (176) hide show
  1. checksums.yaml +7 -0
  2. data/MIT-LICENSE +20 -0
  3. data/README.rdoc +3 -0
  4. data/Rakefile +34 -0
  5. data/app/assets/javascripts/ish_lib_engine/application.js +13 -0
  6. data/app/assets/javascripts/ish_lib_engine/articles.js +2 -0
  7. data/app/assets/stylesheets/ish_lib_engine/application.css +15 -0
  8. data/app/assets/stylesheets/ish_lib_engine/articles.css +4 -0
  9. data/app/assets/stylesheets/scaffold.css +56 -0
  10. data/app/controllers/ish_lib_engine/application_controller.rb +4 -0
  11. data/app/controllers/ish_lib_engine/articles_controller.rb +62 -0
  12. data/app/controllers/ish_lib_engine/manager/cities_controller.rb +95 -0
  13. data/app/controllers/ish_lib_engine/manager/cities_controller.rb~ +95 -0
  14. data/app/controllers/ish_lib_engine/manager/features_controller.rb +122 -0
  15. data/app/controllers/ish_lib_engine/manager/features_controller.rb~ +122 -0
  16. data/app/controllers/ish_lib_engine/manager/galleries_controller.rb +78 -0
  17. data/app/controllers/ish_lib_engine/manager/galleries_controller.rb~ +78 -0
  18. data/app/controllers/ish_lib_engine/manager/manager_controller.rb +31 -0
  19. data/app/controllers/ish_lib_engine/manager/manager_controller.rb~ +31 -0
  20. data/app/controllers/ish_lib_engine/manager/newsitems_controller.rb +47 -0
  21. data/app/controllers/ish_lib_engine/manager/newsitems_controller.rb~ +47 -0
  22. data/app/controllers/ish_lib_engine/manager/photos_controller.rb +20 -0
  23. data/app/controllers/ish_lib_engine/manager/photos_controller.rb~ +20 -0
  24. data/app/controllers/ish_lib_engine/manager/reports_controller.rb +62 -0
  25. data/app/controllers/ish_lib_engine/manager/reports_controller.rb~ +62 -0
  26. data/app/controllers/ish_lib_engine/manager/sites_controller.rb +72 -0
  27. data/app/controllers/ish_lib_engine/manager/sites_controller.rb~ +72 -0
  28. data/app/controllers/ish_lib_engine/manager/tags_controller.rb +54 -0
  29. data/app/controllers/ish_lib_engine/manager/tags_controller.rb~ +54 -0
  30. data/app/controllers/ish_lib_engine/manager/users_controller.rb +13 -0
  31. data/app/controllers/ish_lib_engine/manager/users_controller.rb~ +13 -0
  32. data/app/controllers/ish_lib_engine/manager/welcome_controller.rb +8 -0
  33. data/app/controllers/ish_lib_engine/manager/welcome_controller.rb~ +9 -0
  34. data/app/helpers/ish_lib_engine/application_helper.rb +4 -0
  35. data/app/helpers/ish_lib_engine/articles_helper.rb +4 -0
  36. data/app/models/ability.rb +152 -0
  37. data/app/models/ability.rb~ +151 -0
  38. data/app/models/admin_user.rb +113 -0
  39. data/app/models/app_model2.rb +33 -0
  40. data/app/models/auth_token.rb +17 -0
  41. data/app/models/aux_model.rb +22 -0
  42. data/app/models/cities_user.rb +17 -0
  43. data/app/models/city.rb +117 -0
  44. data/app/models/country.rb +13 -0
  45. data/app/models/day.rb +21 -0
  46. data/app/models/decoded_auth_token.rb +6 -0
  47. data/app/models/event.rb +21 -0
  48. data/app/models/feature.rb +38 -0
  49. data/app/models/gallery.rb +59 -0
  50. data/app/models/ish_lib_engine/article.rb +4 -0
  51. data/app/models/ish_lib_engine/comment.rb +4 -0
  52. data/app/models/manager.rb +10 -0
  53. data/app/models/manager_city.rb +4 -0
  54. data/app/models/manager_feature.rb +4 -0
  55. data/app/models/manager_gallery.rb +3 -0
  56. data/app/models/manager_newsitem.rb +5 -0
  57. data/app/models/manager_photo.rb +3 -0
  58. data/app/models/manager_report.rb +4 -0
  59. data/app/models/manager_site.rb +4 -0
  60. data/app/models/manager_tag.rb +6 -0
  61. data/app/models/manager_user.rb +3 -0
  62. data/app/models/manager_venue.rb +4 -0
  63. data/app/models/message.rb +14 -0
  64. data/app/models/newsitem.rb +50 -0
  65. data/app/models/nodeitem.rb +18 -0
  66. data/app/models/photo.rb +68 -0
  67. data/app/models/rate_me.rb +13 -0
  68. data/app/models/report.rb +144 -0
  69. data/app/models/review.rb +4 -0
  70. data/app/models/site.rb +83 -0
  71. data/app/models/tag.rb +78 -0
  72. data/app/models/user.rb +122 -0
  73. data/app/models/user_profile.rb +20 -0
  74. data/app/models/venue.rb +69 -0
  75. data/app/models/video.rb +48 -0
  76. data/app/models/welcome.rb +6 -0
  77. data/app/models/wikitravel_page.rb +19 -0
  78. data/app/views/application/_flash_messages.haml +24 -0
  79. data/app/views/application/_flash_messages.haml~ +24 -0
  80. data/app/views/ish_lib_engine/articles/_form.html.erb +25 -0
  81. data/app/views/ish_lib_engine/articles/edit.html.erb +6 -0
  82. data/app/views/ish_lib_engine/articles/index.html.erb +29 -0
  83. data/app/views/ish_lib_engine/articles/new.html.erb +5 -0
  84. data/app/views/ish_lib_engine/articles/show.html.erb +14 -0
  85. data/app/views/layouts/ish_lib_engine/application.html.erb +14 -0
  86. data/config/routes.rb +3 -0
  87. data/db/migrate/20160501041837_create_ish_lib_engine_articles.rb +10 -0
  88. data/db/migrate/20160501041940_create_ish_lib_engine_comments.rb +10 -0
  89. data/lib/addressbookitems_tasks.rb +33 -0
  90. data/lib/cities_tasks.rb +143 -0
  91. data/lib/core_extensions.rb +21 -0
  92. data/lib/features_tasks.rb +17 -0
  93. data/lib/float.rb +14 -0
  94. data/lib/galleries_tasks.rb +91 -0
  95. data/lib/ish_lib_engine.rb +4 -0
  96. data/lib/ish_lib_engine/engine.rb +5 -0
  97. data/lib/ish_lib_engine/version.rb +3 -0
  98. data/lib/reports_tasks.rb +53 -0
  99. data/lib/sitemaps_tasks.rb +108 -0
  100. data/lib/sites_tasks.rb +31 -0
  101. data/lib/string.rb +15 -0
  102. data/lib/tags_tasks.rb +104 -0
  103. data/lib/tasks/cities.rake +29 -0
  104. data/lib/tasks/galleries.rake +19 -0
  105. data/lib/tasks/ish_lib_engine_tasks.rake +4 -0
  106. data/lib/tasks/reports.rake +37 -0
  107. data/lib/tasks/resque.rake +8 -0
  108. data/lib/tasks/sitemaps.rake +12 -0
  109. data/lib/tasks/sites.rake +12 -0
  110. data/lib/tasks/tags.rake +17 -0
  111. data/lib/tasks/users.rake +14 -0
  112. data/lib/tasks/venues.rake +13 -0
  113. data/lib/tasks/videos.rake +18 -0
  114. data/lib/tasks/wikitravel_pages.rake +40 -0
  115. data/lib/test_extensions.rb +9 -0
  116. data/lib/u.rb +34 -0
  117. data/lib/users_tasks.rb +88 -0
  118. data/lib/venues_tasks.rb +15 -0
  119. data/lib/videos_tasks.rb +71 -0
  120. data/lib/wikitravel_tasks.rb +139 -0
  121. data/spec/factories/cities.rb +89 -0
  122. data/spec/factories/galleries.rb +133 -0
  123. data/spec/factories/photo.rb +20 -0
  124. data/spec/factories/reports.rb +379 -0
  125. data/spec/factories/site.rb +26 -0
  126. data/spec/factories/tag.rb +42 -0
  127. data/spec/factories/user.rb +87 -0
  128. data/spec/factories/user_profiles.rb +33 -0
  129. data/spec/factories/venues.rb +25 -0
  130. data/spec/factories/videos.rb +38 -0
  131. data/test/controllers/ish_lib_engine/articles_controller_test.rb +52 -0
  132. data/test/dummy/README.rdoc +28 -0
  133. data/test/dummy/Rakefile +6 -0
  134. data/test/dummy/app/assets/javascripts/application.js +13 -0
  135. data/test/dummy/app/assets/stylesheets/application.css +15 -0
  136. data/test/dummy/app/controllers/application_controller.rb +5 -0
  137. data/test/dummy/app/helpers/application_helper.rb +2 -0
  138. data/test/dummy/app/views/layouts/application.html.erb +14 -0
  139. data/test/dummy/bin/bundle +3 -0
  140. data/test/dummy/bin/rails +4 -0
  141. data/test/dummy/bin/rake +4 -0
  142. data/test/dummy/bin/setup +29 -0
  143. data/test/dummy/config.ru +4 -0
  144. data/test/dummy/config/application.rb +26 -0
  145. data/test/dummy/config/boot.rb +5 -0
  146. data/test/dummy/config/database.yml +25 -0
  147. data/test/dummy/config/environment.rb +5 -0
  148. data/test/dummy/config/environments/development.rb +41 -0
  149. data/test/dummy/config/environments/production.rb +79 -0
  150. data/test/dummy/config/environments/test.rb +42 -0
  151. data/test/dummy/config/initializers/assets.rb +11 -0
  152. data/test/dummy/config/initializers/backtrace_silencers.rb +7 -0
  153. data/test/dummy/config/initializers/cookies_serializer.rb +3 -0
  154. data/test/dummy/config/initializers/filter_parameter_logging.rb +4 -0
  155. data/test/dummy/config/initializers/inflections.rb +16 -0
  156. data/test/dummy/config/initializers/mime_types.rb +4 -0
  157. data/test/dummy/config/initializers/session_store.rb +3 -0
  158. data/test/dummy/config/initializers/wrap_parameters.rb +14 -0
  159. data/test/dummy/config/locales/en.yml +23 -0
  160. data/test/dummy/config/routes.rb +4 -0
  161. data/test/dummy/config/secrets.yml +22 -0
  162. data/test/dummy/db/development.sqlite3 +0 -0
  163. data/test/dummy/db/schema.rb +30 -0
  164. data/test/dummy/log/development.log +15 -0
  165. data/test/dummy/public/404.html +67 -0
  166. data/test/dummy/public/422.html +67 -0
  167. data/test/dummy/public/500.html +66 -0
  168. data/test/dummy/public/favicon.ico +0 -0
  169. data/test/fixtures/ish_lib_engine/articles.yml +9 -0
  170. data/test/fixtures/ish_lib_engine/comments.yml +9 -0
  171. data/test/integration/navigation_test.rb +8 -0
  172. data/test/ish_lib_engine_test.rb +7 -0
  173. data/test/models/ish_lib_engine/article_test.rb +9 -0
  174. data/test/models/ish_lib_engine/comment_test.rb +9 -0
  175. data/test/test_helper.rb +21 -0
  176. metadata +361 -0
@@ -0,0 +1,122 @@
1
+
2
+ class User
3
+ include Mongoid::Document
4
+ include Mongoid::Timestamps
5
+
6
+ # Setup accessible (or protected) attributes for your model
7
+ # attr_accessible :email, :password, :password_confirmation, :remember_me
8
+
9
+ ## Database authenticatable
10
+ field :email, type: String, default: ""
11
+ validates :email, :presence => true, :uniqueness => true
12
+
13
+ field :encrypted_password, type: String, default: ""
14
+
15
+ ## Recoverable
16
+ field :reset_password_token, type: String
17
+ field :reset_password_sent_at, type: Time
18
+
19
+ ## Rememberable
20
+ field :remember_created_at, type: Time
21
+
22
+ ## Trackable
23
+ field :sign_in_count, type: Integer, default: 0
24
+ field :current_sign_in_at, type: Time
25
+ field :last_sign_in_at, type: Time
26
+ field :current_sign_in_ip, type: String
27
+ field :last_sign_in_ip, type: String
28
+
29
+ ## Confirmable
30
+ # field :confirmation_token, type: String
31
+ # field :confirmed_at, type: Time
32
+ # field :confirmation_sent_at, type: Time
33
+ # field :unconfirmed_email, type: String # Only if using reconfirmable
34
+
35
+ ## Lockable
36
+ # field :failed_attempts, type: Integer, default: 0 # Only if lock strategy is :failed_attempts
37
+ # field :unlock_token, type: String # Only if unlock strategy is :email or :both
38
+ # field :locked_at, type: Time
39
+
40
+ # :recoverable, :trackable :rememberable,
41
+ # :token_authenticatable,
42
+ # :lockable, :timeoutable, :confirmable
43
+ devise :registerable, :validatable
44
+ devise :database_authenticatable, :authentication_keys => [ :email ]
45
+ # devise :omniauthable, :omniauth_providers => [ :facebook ]
46
+ # devise :encryptable, :encryptor => :sha1base64
47
+ #
48
+ #
49
+ # field :confirmed_at, :type => DateTime
50
+ # field :confirmation_token, :type => String
51
+ # field :confirmation_sent_at, :type => DateTime
52
+
53
+ field :username, :type => String
54
+ validates :username, :presence => true, :uniqueness => true
55
+
56
+ field :name, :type => String
57
+ validates :name, :presence => true
58
+
59
+ field :group_id, :type => Integer, :default => 3
60
+
61
+ field :scratchpad, :type => String
62
+ field :github_path, :type => String
63
+ field :facebook_path, :type => String
64
+ field :stackoverflow_path, :type => String
65
+
66
+ field :is_feature, :type => Boolean, :default => false
67
+ field :is_trash, :type => Boolean, :default => false
68
+
69
+ field :display_ads, :type => Boolean, :default => true
70
+ field :display_help, :type => Boolean, :default => true
71
+
72
+ has_many :reports
73
+ has_many :photos
74
+ has_many :user_profiles
75
+ has_many :galleries
76
+ has_many :videos
77
+
78
+ has_one :profile_photo, :class_name => 'Photo', :inverse_of => :profile_user
79
+
80
+ has_and_belongs_to_many :viewable_photos, :class_name => 'Photo', :inverse_of => :viewer
81
+
82
+ belongs_to :guide_city, :class_name => 'City', :inverse_of => :guide
83
+ belongs_to :current_city, :class_name => 'City', :inverse_of => :city_users
84
+
85
+ def self.list conditions = { :is_trash => false }
86
+ out = self.where( conditions ).order_by( :name => :asc )
87
+ [['', nil]] + out.map { |item| [ item.name, item.id ] }
88
+ end
89
+
90
+ embeds_many :newsitems
91
+
92
+ def self.all
93
+ self.where( :is_trash => false ).order_by( :created_at => :desc )
94
+ end
95
+
96
+ def create_newsitem args = {}
97
+ unless args[:photo].blank?
98
+ n = Newsitem.new
99
+ n.photo = args[:photo]
100
+ n.descr = 'uploaded new photo on'
101
+ n.username = self.username
102
+ self.newsitems << n
103
+ self.save
104
+ end
105
+ end
106
+
107
+ def self.per_page
108
+ 16
109
+ end
110
+
111
+ def self.clear
112
+ if Rails.env.test?
113
+ User.unscoped.each { |u| u.remove }
114
+ end
115
+ end
116
+
117
+ def generate_auth_token
118
+ payload = { user_id: self.id }
119
+ AuthToken.encode(payload)
120
+ end
121
+
122
+ end
@@ -0,0 +1,20 @@
1
+
2
+ class UserProfile
3
+
4
+ include Mongoid::Document
5
+ include Mongoid::Timestamps
6
+
7
+ field :about, :type => String
8
+ field :education, :type => String
9
+ field :objectives, :type => String
10
+ field :current_employment, :type => String
11
+ field :past_employment, :type => String
12
+
13
+ field :pdf_resume_path, :type => String
14
+ field :doc_resume_path, :type => String
15
+
16
+ field :lang, :type => String
17
+
18
+ belongs_to :user
19
+
20
+ end
@@ -0,0 +1,69 @@
1
+
2
+ require 'string'
3
+
4
+ class Venue
5
+
6
+ include Mongoid::Document
7
+ include Mongoid::Timestamps
8
+
9
+ field :name, :type => String
10
+ validates :name, :uniqueness => true, :allow_nil => false
11
+
12
+ field :name_seo, :type => String
13
+ validates :name_seo, :uniqueness => true, :allow_nil => false
14
+
15
+ field :descr, :type => String
16
+
17
+ field :is_trash, :type => Boolean, :default => false
18
+ scope :fresh, ->{ where({ :is_trash => false }) }
19
+ scope :trash, ->{ where({ :is_trash => true }) }
20
+
21
+ field :is_public, :type => Boolean, :default => true
22
+ scope :public, ->{ where({ :is_public => true }) }
23
+ scope :not_public, ->{ where({ :is_public => false }) }
24
+
25
+ field :is_feature, :type => Boolean, :default => false
26
+
27
+ field :x, :type => Float
28
+ field :y, :type => Float
29
+
30
+ field :lang, :type => String, :default => 'en'
31
+
32
+ belongs_to :city
33
+ belongs_to :owner, :class_name => 'User', :inverse_of => :owned_venue
34
+ validates :city, :allow_nil => false, :presence => true
35
+
36
+ has_and_belongs_to_many :users
37
+
38
+ has_one :profile_photo, :class_name => 'Photo', :inverse_of => :profile_venue
39
+
40
+ has_many :reports
41
+ has_many :galleries
42
+ has_many :photos
43
+
44
+ embeds_many :newsitems
45
+ embeds_many :features
46
+
47
+ def self.list conditions = { :is_trash => false }
48
+ out = self.where( conditions).order_by( :name => :asc )
49
+ [['', nil]] + out.map { |item| [ item.name, item.id ] }
50
+ end
51
+
52
+ set_callback(:create, :before) do |doc|
53
+ doc.name_seo = doc.name.to_simple_string
54
+ end
55
+
56
+ def self.types
57
+ return []
58
+ # if 'en' == @locale
59
+ # [ 'Hotels', 'Restaurants', 'Bars' ]
60
+ # else
61
+ # [ 'Hotels', 'Restaurants', 'Bars' ]
62
+ # end
63
+ end
64
+
65
+ def self.n_features
66
+ 6
67
+ end
68
+
69
+ end
@@ -0,0 +1,48 @@
1
+
2
+ class Video
3
+
4
+ include Mongoid::Document
5
+ include Mongoid::Timestamps
6
+
7
+ PER_PAGE = 6
8
+
9
+ field :name, :type => String
10
+ field :descr, :type => String
11
+
12
+ default_scope ->{ where({ :is_public => true, :is_trash => false }).order_by({ :created_at => :desc }) }
13
+
14
+ field :is_trash, :type => Boolean, :default => false
15
+ field :is_public, :type => Boolean, :default => true
16
+ field :is_feature, :type => Boolean, :default => false
17
+
18
+ field :x, :type => Float
19
+ field :y, :type => Float
20
+
21
+ field :lang, :type => String, :default => 'en'
22
+
23
+ field :youtube_id, :type => String
24
+ validates :youtube_id, :uniqueness => true, :presence => true
25
+
26
+ belongs_to :tag
27
+ belongs_to :city
28
+ belongs_to :site
29
+ validates :site, :presence => true
30
+ belongs_to :user
31
+ validates :user, :presence => true
32
+
33
+ accepts_nested_attributes_for :site, :tag, :city
34
+
35
+
36
+ def self.list
37
+ [['', nil]] + Video.all.order_by( :name => :desc ).map { |item| [ item.name, item.id ] }
38
+ end
39
+
40
+ set_callback( :create, :before ) do |doc|
41
+ if doc.is_public
42
+ doc.city.add_newsitem( doc ) unless doc.city.blank?
43
+ doc.site.add_newsitem( doc ) unless doc.site.blank?
44
+ end
45
+
46
+ end
47
+
48
+ end
@@ -0,0 +1,6 @@
1
+
2
+
3
+ class Welcome
4
+ # for Ability
5
+
6
+ end
@@ -0,0 +1,19 @@
1
+ class WikitravelPage
2
+ include Mongoid::Document
3
+ include Mongoid::Timestamps
4
+
5
+ field :title, :type => String
6
+ validates :title, :presence => true, :uniqueness => true
7
+
8
+ field :url, :type => String
9
+ validates :url, :presence => true, :uniqueness => true
10
+
11
+ def self.clear
12
+ if Rails.env.test?
13
+ self.each { |r| r.remove }
14
+ end
15
+ end
16
+
17
+ DOMAIN = 'http://wikitravel.org'
18
+
19
+ end
@@ -0,0 +1,24 @@
1
+
2
+ .a
3
+ .b
4
+ .c
5
+ .d
6
+ - if flash[:notice]
7
+ %br
8
+ .callout{ 'data-closable' => '' }
9
+ = flash[:notice]
10
+ %button.close-button{ 'aria-label' => 'Dismiss alert', :type => 'button', 'data-close' => '' }
11
+ %span{ 'aria-hidden' => 'true' } &times;
12
+ - if flash[:error]
13
+ %br
14
+ .callout.alert{ 'data-closable' => '' }
15
+ = flash[:error]
16
+ %button.close-button{ 'aria-label' => 'Dismiss alert', :type => 'button', 'data-close' => '' }
17
+ %span{ 'aria-hidden' => 'true' } &times;
18
+ - if flash[:alert] # cancan does this
19
+ %br
20
+ .callout.alert{ 'data-closable' => '' }
21
+ = flash[:alert]
22
+ %button.close-button{ 'aria-label' => 'Dismiss alert', :type => 'button', 'data-close' => '' }
23
+ %span{ 'aria-hidden' => 'true' } &times;
24
+
@@ -0,0 +1,24 @@
1
+
2
+ .a
3
+ .b
4
+ .c
5
+ .d
6
+ - if flash[:notice]
7
+ %br
8
+ .callout{ 'data-closable' => '' }
9
+ = flash[:notice]
10
+ %button.close-button{ 'aria-label' => 'Dismiss alert', :type => 'button', 'data-close' => '' }
11
+ %span{ 'aria-hidden' => 'true' } &times;
12
+ - if flash[:error]
13
+ %br
14
+ .callout.alert{ 'data-closable' => '' }
15
+ = flash[:error]
16
+ %button.close-button{ 'aria-label' => 'Dismiss alert', :type => 'button', 'data-close' => '' }
17
+ %span{ 'aria-hidden' => 'true' } &times;
18
+ - if flash[:alert] # cancan does this
19
+ %br
20
+ .callout.alert{ 'data-closable' => '' }
21
+ = flash[:alert]
22
+ %button.close-button{ 'aria-label' => 'Dismiss alert', :type => 'button', 'data-close' => '' }
23
+ %span{ 'aria-hidden' => 'true' } &times;
24
+
@@ -0,0 +1,25 @@
1
+ <%= form_for(@article) do |f| %>
2
+ <% if @article.errors.any? %>
3
+ <div id="error_explanation">
4
+ <h2><%= pluralize(@article.errors.count, "error") %> prohibited this article from being saved:</h2>
5
+
6
+ <ul>
7
+ <% @article.errors.full_messages.each do |message| %>
8
+ <li><%= message %></li>
9
+ <% end %>
10
+ </ul>
11
+ </div>
12
+ <% end %>
13
+
14
+ <div class="field">
15
+ <%= f.label :title %><br>
16
+ <%= f.text_field :title %>
17
+ </div>
18
+ <div class="field">
19
+ <%= f.label :body %><br>
20
+ <%= f.text_area :body %>
21
+ </div>
22
+ <div class="actions">
23
+ <%= f.submit %>
24
+ </div>
25
+ <% end %>
@@ -0,0 +1,6 @@
1
+ <h1>Editing Article</h1>
2
+
3
+ <%= render 'form' %>
4
+
5
+ <%= link_to 'Show', @article %> |
6
+ <%= link_to 'Back', articles_path %>
@@ -0,0 +1,29 @@
1
+ <p id="notice"><%= notice %></p>
2
+
3
+ <h1>Listing Articles</h1>
4
+
5
+ <table>
6
+ <thead>
7
+ <tr>
8
+ <th>Title</th>
9
+ <th>Body</th>
10
+ <th colspan="3"></th>
11
+ </tr>
12
+ </thead>
13
+
14
+ <tbody>
15
+ <% @articles.each do |article| %>
16
+ <tr>
17
+ <td><%= article.title %></td>
18
+ <td><%= article.body %></td>
19
+ <td><%= link_to 'Show', article %></td>
20
+ <td><%= link_to 'Edit', edit_article_path(article) %></td>
21
+ <td><%= link_to 'Destroy', article, method: :delete, data: { confirm: 'Are you sure?' } %></td>
22
+ </tr>
23
+ <% end %>
24
+ </tbody>
25
+ </table>
26
+
27
+ <br>
28
+
29
+ <%= link_to 'New Article', new_article_path %>
@@ -0,0 +1,5 @@
1
+ <h1>New Article</h1>
2
+
3
+ <%= render 'form' %>
4
+
5
+ <%= link_to 'Back', articles_path %>
@@ -0,0 +1,14 @@
1
+ <p id="notice"><%= notice %></p>
2
+
3
+ <p>
4
+ <strong>Title:</strong>
5
+ <%= @article.title %>
6
+ </p>
7
+
8
+ <p>
9
+ <strong>Body:</strong>
10
+ <%= @article.body %>
11
+ </p>
12
+
13
+ <%= link_to 'Edit', edit_article_path(@article) %> |
14
+ <%= link_to 'Back', articles_path %>
@@ -0,0 +1,14 @@
1
+ <!DOCTYPE html>
2
+ <html>
3
+ <head>
4
+ <title>IshLibEngine</title>
5
+ <%= stylesheet_link_tag "ish_lib_engine/application", media: "all" %>
6
+ <%= javascript_include_tag "ish_lib_engine/application" %>
7
+ <%= csrf_meta_tags %>
8
+ </head>
9
+ <body>
10
+
11
+ <%= yield %>
12
+
13
+ </body>
14
+ </html>