ishapi 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/MIT-LICENSE +20 -0
- data/README.md +28 -0
- data/Rakefile +36 -0
- data/app/assets/config/ishapi_manifest.js +2 -0
- data/app/assets/javascripts/ishapi/application.js +13 -0
- data/app/assets/javascripts/ishapi/articles.js +2 -0
- data/app/assets/stylesheets/ishapi/application.css +15 -0
- data/app/assets/stylesheets/ishapi/articles.css +4 -0
- data/app/assets/stylesheets/scaffold.css +80 -0
- data/app/controllers/ishapi/api_controller.rb +72 -0
- data/app/controllers/ishapi/api_controller.rb~ +62 -0
- data/app/controllers/ishapi/application_controller.rb +5 -0
- data/app/controllers/ishapi/articles_controller.rb +62 -0
- data/app/controllers/ishapi/cities_controller.rb +16 -0
- data/app/controllers/ishapi/cities_controller.rb~ +72 -0
- data/app/helpers/ishapi/application_helper.rb +4 -0
- data/app/helpers/ishapi/articles_helper.rb +4 -0
- data/app/jobs/ishapi/application_job.rb +4 -0
- data/app/mailers/ishapi/application_mailer.rb +6 -0
- data/app/models/ishapi/application_record.rb +5 -0
- data/app/models/ishapi/article.rb +4 -0
- data/app/views/ishapi/articles/_form.html.erb +27 -0
- data/app/views/ishapi/articles/edit.html.erb +6 -0
- data/app/views/ishapi/articles/index.html.erb +29 -0
- data/app/views/ishapi/articles/new.html.erb +5 -0
- data/app/views/ishapi/articles/show.html.erb +14 -0
- data/app/views/ishapi/cities/index.jbuilder +4 -0
- data/app/views/ishapi/cities/show.jbuilder +13 -0
- data/app/views/ishapi/cities/show.jbuilder~ +13 -0
- data/app/views/layouts/ishapi/application.html.erb +14 -0
- data/config/routes.rb +12 -0
- data/db/migrate/20170510193542_create_ishapi_articles.rb +10 -0
- data/lib/ishapi.rb +5 -0
- data/lib/ishapi/engine.rb +5 -0
- data/lib/ishapi/version.rb +3 -0
- data/lib/tasks/ishapi_tasks.rake +4 -0
- metadata +108 -0
checksums.yaml
ADDED
@@ -0,0 +1,7 @@
|
|
1
|
+
---
|
2
|
+
SHA1:
|
3
|
+
metadata.gz: 016e158403897ec6cfd97e14f36532f9b615c14d
|
4
|
+
data.tar.gz: 256e73bc279fcbeab0f800c45ce92a74283a6637
|
5
|
+
SHA512:
|
6
|
+
metadata.gz: 8678bd7fda290bcd841f1e3ba4217f6ca7eb5a1301918d59427a66ac9b2c45de1a94ec81034ede5cbe3082e2dd282bdd52798701492b319bebdf5f27e4a1b445
|
7
|
+
data.tar.gz: 7867b5f5fe1b339698c2723b459066223a1884e32c58adc3f89e2a17bfae3b035af74875bf64674b162b375d5fa57de459345337e2818a1263a4d042928433fd
|
data/MIT-LICENSE
ADDED
@@ -0,0 +1,20 @@
|
|
1
|
+
Copyright 2017 piousbox
|
2
|
+
|
3
|
+
Permission is hereby granted, free of charge, to any person obtaining
|
4
|
+
a copy of this software and associated documentation files (the
|
5
|
+
"Software"), to deal in the Software without restriction, including
|
6
|
+
without limitation the rights to use, copy, modify, merge, publish,
|
7
|
+
distribute, sublicense, and/or sell copies of the Software, and to
|
8
|
+
permit persons to whom the Software is furnished to do so, subject to
|
9
|
+
the following conditions:
|
10
|
+
|
11
|
+
The above copyright notice and this permission notice shall be
|
12
|
+
included in all copies or substantial portions of the Software.
|
13
|
+
|
14
|
+
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND,
|
15
|
+
EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF
|
16
|
+
MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND
|
17
|
+
NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE
|
18
|
+
LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION
|
19
|
+
OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION
|
20
|
+
WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
|
data/README.md
ADDED
@@ -0,0 +1,28 @@
|
|
1
|
+
# Ishapi
|
2
|
+
Short description and motivation.
|
3
|
+
|
4
|
+
## Usage
|
5
|
+
How to use my plugin.
|
6
|
+
|
7
|
+
## Installation
|
8
|
+
Add this line to your application's Gemfile:
|
9
|
+
|
10
|
+
```ruby
|
11
|
+
gem 'ishapi'
|
12
|
+
```
|
13
|
+
|
14
|
+
And then execute:
|
15
|
+
```bash
|
16
|
+
$ bundle
|
17
|
+
```
|
18
|
+
|
19
|
+
Or install it yourself as:
|
20
|
+
```bash
|
21
|
+
$ gem install ishapi
|
22
|
+
```
|
23
|
+
|
24
|
+
## Contributing
|
25
|
+
Contribution directions go here.
|
26
|
+
|
27
|
+
## License
|
28
|
+
The gem is available as open source under the terms of the [MIT License](http://opensource.org/licenses/MIT).
|
data/Rakefile
ADDED
@@ -0,0 +1,36 @@
|
|
1
|
+
begin
|
2
|
+
require 'bundler/setup'
|
3
|
+
rescue LoadError
|
4
|
+
puts 'You must `gem install bundler` and `bundle install` to run rake tasks'
|
5
|
+
end
|
6
|
+
|
7
|
+
require 'rdoc/task'
|
8
|
+
|
9
|
+
RDoc::Task.new(:rdoc) do |rdoc|
|
10
|
+
rdoc.rdoc_dir = 'rdoc'
|
11
|
+
rdoc.title = 'Ishapi'
|
12
|
+
rdoc.options << '--line-numbers'
|
13
|
+
rdoc.rdoc_files.include('README.md')
|
14
|
+
rdoc.rdoc_files.include('lib/**/*.rb')
|
15
|
+
end
|
16
|
+
|
17
|
+
APP_RAKEFILE = File.expand_path("../test/dummy/Rakefile", __FILE__)
|
18
|
+
load 'rails/tasks/engine.rake'
|
19
|
+
|
20
|
+
|
21
|
+
load 'rails/tasks/statistics.rake'
|
22
|
+
|
23
|
+
|
24
|
+
|
25
|
+
require 'bundler/gem_tasks'
|
26
|
+
|
27
|
+
require 'rake/testtask'
|
28
|
+
|
29
|
+
Rake::TestTask.new(:test) do |t|
|
30
|
+
t.libs << 'test'
|
31
|
+
t.pattern = 'test/**/*_test.rb'
|
32
|
+
t.verbose = false
|
33
|
+
end
|
34
|
+
|
35
|
+
|
36
|
+
task default: :test
|
@@ -0,0 +1,13 @@
|
|
1
|
+
// This is a manifest file that'll be compiled into application.js, which will include all the files
|
2
|
+
// listed below.
|
3
|
+
//
|
4
|
+
// Any JavaScript/Coffee file within this directory, lib/assets/javascripts, vendor/assets/javascripts,
|
5
|
+
// or any plugin's vendor/assets/javascripts directory can be referenced here using a relative path.
|
6
|
+
//
|
7
|
+
// It's not advisable to add code directly here, but if you do, it'll appear at the bottom of the
|
8
|
+
// compiled file. JavaScript code in this file should be added after the last require_* statement.
|
9
|
+
//
|
10
|
+
// Read Sprockets README (https://github.com/rails/sprockets#sprockets-directives) for details
|
11
|
+
// about supported directives.
|
12
|
+
//
|
13
|
+
//= require_tree .
|
@@ -0,0 +1,15 @@
|
|
1
|
+
/*
|
2
|
+
* This is a manifest file that'll be compiled into application.css, which will include all the files
|
3
|
+
* listed below.
|
4
|
+
*
|
5
|
+
* Any CSS and SCSS file within this directory, lib/assets/stylesheets, vendor/assets/stylesheets,
|
6
|
+
* or any plugin's vendor/assets/stylesheets directory can be referenced here using a relative path.
|
7
|
+
*
|
8
|
+
* You're free to add application-wide styles to this file and they'll appear at the bottom of the
|
9
|
+
* compiled file so the styles you add here take precedence over styles defined in any other CSS/SCSS
|
10
|
+
* files in this directory. Styles in this file should be added after the last require_* statement.
|
11
|
+
* It is generally better to create a new file per style scope.
|
12
|
+
*
|
13
|
+
*= require_tree .
|
14
|
+
*= require_self
|
15
|
+
*/
|
@@ -0,0 +1,80 @@
|
|
1
|
+
body {
|
2
|
+
background-color: #fff;
|
3
|
+
color: #333;
|
4
|
+
margin: 33px;
|
5
|
+
}
|
6
|
+
|
7
|
+
body, p, ol, ul, td {
|
8
|
+
font-family: verdana, arial, helvetica, sans-serif;
|
9
|
+
font-size: 13px;
|
10
|
+
line-height: 18px;
|
11
|
+
}
|
12
|
+
|
13
|
+
pre {
|
14
|
+
background-color: #eee;
|
15
|
+
padding: 10px;
|
16
|
+
font-size: 11px;
|
17
|
+
}
|
18
|
+
|
19
|
+
a {
|
20
|
+
color: #000;
|
21
|
+
}
|
22
|
+
|
23
|
+
a:visited {
|
24
|
+
color: #666;
|
25
|
+
}
|
26
|
+
|
27
|
+
a:hover {
|
28
|
+
color: #fff;
|
29
|
+
background-color: #000;
|
30
|
+
}
|
31
|
+
|
32
|
+
th {
|
33
|
+
padding-bottom: 5px;
|
34
|
+
}
|
35
|
+
|
36
|
+
td {
|
37
|
+
padding: 0 5px 7px;
|
38
|
+
}
|
39
|
+
|
40
|
+
div.field,
|
41
|
+
div.actions {
|
42
|
+
margin-bottom: 10px;
|
43
|
+
}
|
44
|
+
|
45
|
+
#notice {
|
46
|
+
color: green;
|
47
|
+
}
|
48
|
+
|
49
|
+
.field_with_errors {
|
50
|
+
padding: 2px;
|
51
|
+
background-color: red;
|
52
|
+
display: table;
|
53
|
+
}
|
54
|
+
|
55
|
+
#error_explanation {
|
56
|
+
width: 450px;
|
57
|
+
border: 2px solid red;
|
58
|
+
padding: 7px 7px 0;
|
59
|
+
margin-bottom: 20px;
|
60
|
+
background-color: #f0f0f0;
|
61
|
+
}
|
62
|
+
|
63
|
+
#error_explanation h2 {
|
64
|
+
text-align: left;
|
65
|
+
font-weight: bold;
|
66
|
+
padding: 5px 5px 5px 15px;
|
67
|
+
font-size: 12px;
|
68
|
+
margin: -7px -7px 0;
|
69
|
+
background-color: #c00;
|
70
|
+
color: #fff;
|
71
|
+
}
|
72
|
+
|
73
|
+
#error_explanation ul li {
|
74
|
+
font-size: 12px;
|
75
|
+
list-style: square;
|
76
|
+
}
|
77
|
+
|
78
|
+
label {
|
79
|
+
display: block;
|
80
|
+
}
|
@@ -0,0 +1,72 @@
|
|
1
|
+
|
2
|
+
require_dependency "ishapi/application_controller"
|
3
|
+
|
4
|
+
module Ishapi
|
5
|
+
class ApiController < ApplicationController
|
6
|
+
|
7
|
+
def home
|
8
|
+
render :json => { :status => :ok, :message => 'Ishapi::ApiController.home',
|
9
|
+
:n_reports => Report.count, :n_cities => City.count }
|
10
|
+
end
|
11
|
+
|
12
|
+
=begin
|
13
|
+
before_action :set_article, only: [:show, :edit, :update, :destroy]
|
14
|
+
|
15
|
+
# GET /articles
|
16
|
+
def index
|
17
|
+
@articles = Article.all
|
18
|
+
end
|
19
|
+
|
20
|
+
# GET /articles/1
|
21
|
+
def show
|
22
|
+
end
|
23
|
+
|
24
|
+
# GET /articles/new
|
25
|
+
def new
|
26
|
+
@article = Article.new
|
27
|
+
end
|
28
|
+
|
29
|
+
# GET /articles/1/edit
|
30
|
+
def edit
|
31
|
+
end
|
32
|
+
|
33
|
+
# POST /articles
|
34
|
+
def create
|
35
|
+
@article = Article.new(article_params)
|
36
|
+
|
37
|
+
if @article.save
|
38
|
+
redirect_to @article, notice: 'Article was successfully created.'
|
39
|
+
else
|
40
|
+
render :new
|
41
|
+
end
|
42
|
+
end
|
43
|
+
|
44
|
+
# PATCH/PUT /articles/1
|
45
|
+
def update
|
46
|
+
if @article.update(article_params)
|
47
|
+
redirect_to @article, notice: 'Article was successfully updated.'
|
48
|
+
else
|
49
|
+
render :edit
|
50
|
+
end
|
51
|
+
end
|
52
|
+
|
53
|
+
# DELETE /articles/1
|
54
|
+
def destroy
|
55
|
+
@article.destroy
|
56
|
+
redirect_to articles_url, notice: 'Article was successfully destroyed.'
|
57
|
+
end
|
58
|
+
|
59
|
+
private
|
60
|
+
# Use callbacks to share common setup or constraints between actions.
|
61
|
+
def set_article
|
62
|
+
@article = Article.find(params[:id])
|
63
|
+
end
|
64
|
+
|
65
|
+
# Only allow a trusted parameter "white list" through.
|
66
|
+
def article_params
|
67
|
+
params.require(:article).permit(:title, :text)
|
68
|
+
end
|
69
|
+
=end
|
70
|
+
|
71
|
+
end
|
72
|
+
end
|
@@ -0,0 +1,62 @@
|
|
1
|
+
require_dependency "ishapi/application_controller"
|
2
|
+
|
3
|
+
module Ishapi
|
4
|
+
class ArticlesController < ApplicationController
|
5
|
+
before_action :set_article, only: [:show, :edit, :update, :destroy]
|
6
|
+
|
7
|
+
# GET /articles
|
8
|
+
def index
|
9
|
+
@articles = Article.all
|
10
|
+
end
|
11
|
+
|
12
|
+
# GET /articles/1
|
13
|
+
def show
|
14
|
+
end
|
15
|
+
|
16
|
+
# GET /articles/new
|
17
|
+
def new
|
18
|
+
@article = Article.new
|
19
|
+
end
|
20
|
+
|
21
|
+
# GET /articles/1/edit
|
22
|
+
def edit
|
23
|
+
end
|
24
|
+
|
25
|
+
# POST /articles
|
26
|
+
def create
|
27
|
+
@article = Article.new(article_params)
|
28
|
+
|
29
|
+
if @article.save
|
30
|
+
redirect_to @article, notice: 'Article was successfully created.'
|
31
|
+
else
|
32
|
+
render :new
|
33
|
+
end
|
34
|
+
end
|
35
|
+
|
36
|
+
# PATCH/PUT /articles/1
|
37
|
+
def update
|
38
|
+
if @article.update(article_params)
|
39
|
+
redirect_to @article, notice: 'Article was successfully updated.'
|
40
|
+
else
|
41
|
+
render :edit
|
42
|
+
end
|
43
|
+
end
|
44
|
+
|
45
|
+
# DELETE /articles/1
|
46
|
+
def destroy
|
47
|
+
@article.destroy
|
48
|
+
redirect_to articles_url, notice: 'Article was successfully destroyed.'
|
49
|
+
end
|
50
|
+
|
51
|
+
private
|
52
|
+
# Use callbacks to share common setup or constraints between actions.
|
53
|
+
def set_article
|
54
|
+
@article = Article.find(params[:id])
|
55
|
+
end
|
56
|
+
|
57
|
+
# Only allow a trusted parameter "white list" through.
|
58
|
+
def article_params
|
59
|
+
params.require(:article).permit(:title, :text)
|
60
|
+
end
|
61
|
+
end
|
62
|
+
end
|
@@ -0,0 +1,62 @@
|
|
1
|
+
require_dependency "ishapi/application_controller"
|
2
|
+
|
3
|
+
module Ishapi
|
4
|
+
class ArticlesController < ApplicationController
|
5
|
+
before_action :set_article, only: [:show, :edit, :update, :destroy]
|
6
|
+
|
7
|
+
# GET /articles
|
8
|
+
def index
|
9
|
+
@articles = Article.all
|
10
|
+
end
|
11
|
+
|
12
|
+
# GET /articles/1
|
13
|
+
def show
|
14
|
+
end
|
15
|
+
|
16
|
+
# GET /articles/new
|
17
|
+
def new
|
18
|
+
@article = Article.new
|
19
|
+
end
|
20
|
+
|
21
|
+
# GET /articles/1/edit
|
22
|
+
def edit
|
23
|
+
end
|
24
|
+
|
25
|
+
# POST /articles
|
26
|
+
def create
|
27
|
+
@article = Article.new(article_params)
|
28
|
+
|
29
|
+
if @article.save
|
30
|
+
redirect_to @article, notice: 'Article was successfully created.'
|
31
|
+
else
|
32
|
+
render :new
|
33
|
+
end
|
34
|
+
end
|
35
|
+
|
36
|
+
# PATCH/PUT /articles/1
|
37
|
+
def update
|
38
|
+
if @article.update(article_params)
|
39
|
+
redirect_to @article, notice: 'Article was successfully updated.'
|
40
|
+
else
|
41
|
+
render :edit
|
42
|
+
end
|
43
|
+
end
|
44
|
+
|
45
|
+
# DELETE /articles/1
|
46
|
+
def destroy
|
47
|
+
@article.destroy
|
48
|
+
redirect_to articles_url, notice: 'Article was successfully destroyed.'
|
49
|
+
end
|
50
|
+
|
51
|
+
private
|
52
|
+
# Use callbacks to share common setup or constraints between actions.
|
53
|
+
def set_article
|
54
|
+
@article = Article.find(params[:id])
|
55
|
+
end
|
56
|
+
|
57
|
+
# Only allow a trusted parameter "white list" through.
|
58
|
+
def article_params
|
59
|
+
params.require(:article).permit(:title, :text)
|
60
|
+
end
|
61
|
+
end
|
62
|
+
end
|
@@ -0,0 +1,16 @@
|
|
1
|
+
|
2
|
+
require_dependency "ishapi/application_controller"
|
3
|
+
|
4
|
+
module Ishapi
|
5
|
+
class CitiesController < ApplicationController
|
6
|
+
|
7
|
+
def index
|
8
|
+
@cities = City.all
|
9
|
+
end
|
10
|
+
|
11
|
+
def show
|
12
|
+
@city = City.find_by :cityname => params[:cityname]
|
13
|
+
end
|
14
|
+
|
15
|
+
end
|
16
|
+
end
|
@@ -0,0 +1,72 @@
|
|
1
|
+
|
2
|
+
require_dependency "ishapi/application_controller"
|
3
|
+
|
4
|
+
module Ishapi
|
5
|
+
class ApiController < ApplicationController
|
6
|
+
|
7
|
+
def home
|
8
|
+
render :json => { :status => :ok, :message => 'Ishapi::ApiController.home',
|
9
|
+
:n_reports => Report.count, :n_cities => City.count }
|
10
|
+
end
|
11
|
+
|
12
|
+
=begin
|
13
|
+
before_action :set_article, only: [:show, :edit, :update, :destroy]
|
14
|
+
|
15
|
+
# GET /articles
|
16
|
+
def index
|
17
|
+
@articles = Article.all
|
18
|
+
end
|
19
|
+
|
20
|
+
# GET /articles/1
|
21
|
+
def show
|
22
|
+
end
|
23
|
+
|
24
|
+
# GET /articles/new
|
25
|
+
def new
|
26
|
+
@article = Article.new
|
27
|
+
end
|
28
|
+
|
29
|
+
# GET /articles/1/edit
|
30
|
+
def edit
|
31
|
+
end
|
32
|
+
|
33
|
+
# POST /articles
|
34
|
+
def create
|
35
|
+
@article = Article.new(article_params)
|
36
|
+
|
37
|
+
if @article.save
|
38
|
+
redirect_to @article, notice: 'Article was successfully created.'
|
39
|
+
else
|
40
|
+
render :new
|
41
|
+
end
|
42
|
+
end
|
43
|
+
|
44
|
+
# PATCH/PUT /articles/1
|
45
|
+
def update
|
46
|
+
if @article.update(article_params)
|
47
|
+
redirect_to @article, notice: 'Article was successfully updated.'
|
48
|
+
else
|
49
|
+
render :edit
|
50
|
+
end
|
51
|
+
end
|
52
|
+
|
53
|
+
# DELETE /articles/1
|
54
|
+
def destroy
|
55
|
+
@article.destroy
|
56
|
+
redirect_to articles_url, notice: 'Article was successfully destroyed.'
|
57
|
+
end
|
58
|
+
|
59
|
+
private
|
60
|
+
# Use callbacks to share common setup or constraints between actions.
|
61
|
+
def set_article
|
62
|
+
@article = Article.find(params[:id])
|
63
|
+
end
|
64
|
+
|
65
|
+
# Only allow a trusted parameter "white list" through.
|
66
|
+
def article_params
|
67
|
+
params.require(:article).permit(:title, :text)
|
68
|
+
end
|
69
|
+
=end
|
70
|
+
|
71
|
+
end
|
72
|
+
end
|
@@ -0,0 +1,27 @@
|
|
1
|
+
<%= form_with(model: article, local: true) do |form| %>
|
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
|
+
<%= form.label :title %>
|
16
|
+
<%= form.text_field :title, id: :article_title %>
|
17
|
+
</div>
|
18
|
+
|
19
|
+
<div class="field">
|
20
|
+
<%= form.label :text %>
|
21
|
+
<%= form.text_area :text, id: :article_text %>
|
22
|
+
</div>
|
23
|
+
|
24
|
+
<div class="actions">
|
25
|
+
<%= form.submit %>
|
26
|
+
</div>
|
27
|
+
<% end %>
|
@@ -0,0 +1,29 @@
|
|
1
|
+
<p id="notice"><%= notice %></p>
|
2
|
+
|
3
|
+
<h1>Articles</h1>
|
4
|
+
|
5
|
+
<table>
|
6
|
+
<thead>
|
7
|
+
<tr>
|
8
|
+
<th>Title</th>
|
9
|
+
<th>Text</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.text %></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,14 @@
|
|
1
|
+
<p id="notice"><%= notice %></p>
|
2
|
+
|
3
|
+
<p>
|
4
|
+
<strong>Title:</strong>
|
5
|
+
<%= @article.title %>
|
6
|
+
</p>
|
7
|
+
|
8
|
+
<p>
|
9
|
+
<strong>Text:</strong>
|
10
|
+
<%= @article.text %>
|
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>Ishapi</title>
|
5
|
+
<%= stylesheet_link_tag "ishapi/application", media: "all" %>
|
6
|
+
<%= javascript_include_tag "ishapi/application" %>
|
7
|
+
<%= csrf_meta_tags %>
|
8
|
+
</head>
|
9
|
+
<body>
|
10
|
+
|
11
|
+
<%= yield %>
|
12
|
+
|
13
|
+
</body>
|
14
|
+
</html>
|
data/config/routes.rb
ADDED
@@ -0,0 +1,12 @@
|
|
1
|
+
|
2
|
+
Ishapi::Engine.routes.draw do
|
3
|
+
|
4
|
+
root :to => 'api#home'
|
5
|
+
|
6
|
+
get 'cities', :to => 'cities#index'
|
7
|
+
get 'cities/view/:cityname', :to => 'cities#show'
|
8
|
+
|
9
|
+
get 'reports', :to => 'reports#index'
|
10
|
+
get 'reports/view/:report_name', :to => 'reports#show'
|
11
|
+
|
12
|
+
end
|
data/lib/ishapi.rb
ADDED
metadata
ADDED
@@ -0,0 +1,108 @@
|
|
1
|
+
--- !ruby/object:Gem::Specification
|
2
|
+
name: ishapi
|
3
|
+
version: !ruby/object:Gem::Version
|
4
|
+
version: 0.1.0
|
5
|
+
platform: ruby
|
6
|
+
authors:
|
7
|
+
- piousbox
|
8
|
+
autorequire:
|
9
|
+
bindir: bin
|
10
|
+
cert_chain: []
|
11
|
+
date: 2017-05-10 00:00:00.000000000 Z
|
12
|
+
dependencies:
|
13
|
+
- !ruby/object:Gem::Dependency
|
14
|
+
name: rails
|
15
|
+
requirement: !ruby/object:Gem::Requirement
|
16
|
+
requirements:
|
17
|
+
- - "~>"
|
18
|
+
- !ruby/object:Gem::Version
|
19
|
+
version: 5.1.0
|
20
|
+
type: :runtime
|
21
|
+
prerelease: false
|
22
|
+
version_requirements: !ruby/object:Gem::Requirement
|
23
|
+
requirements:
|
24
|
+
- - "~>"
|
25
|
+
- !ruby/object:Gem::Version
|
26
|
+
version: 5.1.0
|
27
|
+
- !ruby/object:Gem::Dependency
|
28
|
+
name: sqlite3
|
29
|
+
requirement: !ruby/object:Gem::Requirement
|
30
|
+
requirements:
|
31
|
+
- - ">="
|
32
|
+
- !ruby/object:Gem::Version
|
33
|
+
version: '0'
|
34
|
+
type: :development
|
35
|
+
prerelease: false
|
36
|
+
version_requirements: !ruby/object:Gem::Requirement
|
37
|
+
requirements:
|
38
|
+
- - ">="
|
39
|
+
- !ruby/object:Gem::Version
|
40
|
+
version: '0'
|
41
|
+
description: " Description of Ishapi."
|
42
|
+
email:
|
43
|
+
- piousbox@gmail.com
|
44
|
+
executables: []
|
45
|
+
extensions: []
|
46
|
+
extra_rdoc_files: []
|
47
|
+
files:
|
48
|
+
- MIT-LICENSE
|
49
|
+
- README.md
|
50
|
+
- Rakefile
|
51
|
+
- app/assets/config/ishapi_manifest.js
|
52
|
+
- app/assets/javascripts/ishapi/application.js
|
53
|
+
- app/assets/javascripts/ishapi/articles.js
|
54
|
+
- app/assets/stylesheets/ishapi/application.css
|
55
|
+
- app/assets/stylesheets/ishapi/articles.css
|
56
|
+
- app/assets/stylesheets/scaffold.css
|
57
|
+
- app/controllers/ishapi/api_controller.rb
|
58
|
+
- app/controllers/ishapi/api_controller.rb~
|
59
|
+
- app/controllers/ishapi/application_controller.rb
|
60
|
+
- app/controllers/ishapi/articles_controller.rb
|
61
|
+
- app/controllers/ishapi/cities_controller.rb
|
62
|
+
- app/controllers/ishapi/cities_controller.rb~
|
63
|
+
- app/helpers/ishapi/application_helper.rb
|
64
|
+
- app/helpers/ishapi/articles_helper.rb
|
65
|
+
- app/jobs/ishapi/application_job.rb
|
66
|
+
- app/mailers/ishapi/application_mailer.rb
|
67
|
+
- app/models/ishapi/application_record.rb
|
68
|
+
- app/models/ishapi/article.rb
|
69
|
+
- app/views/ishapi/articles/_form.html.erb
|
70
|
+
- app/views/ishapi/articles/edit.html.erb
|
71
|
+
- app/views/ishapi/articles/index.html.erb
|
72
|
+
- app/views/ishapi/articles/new.html.erb
|
73
|
+
- app/views/ishapi/articles/show.html.erb
|
74
|
+
- app/views/ishapi/cities/index.jbuilder
|
75
|
+
- app/views/ishapi/cities/show.jbuilder
|
76
|
+
- app/views/ishapi/cities/show.jbuilder~
|
77
|
+
- app/views/layouts/ishapi/application.html.erb
|
78
|
+
- config/routes.rb
|
79
|
+
- db/migrate/20170510193542_create_ishapi_articles.rb
|
80
|
+
- lib/ishapi.rb
|
81
|
+
- lib/ishapi/engine.rb
|
82
|
+
- lib/ishapi/version.rb
|
83
|
+
- lib/tasks/ishapi_tasks.rake
|
84
|
+
homepage: http://wasya.co
|
85
|
+
licenses:
|
86
|
+
- MIT
|
87
|
+
metadata: {}
|
88
|
+
post_install_message:
|
89
|
+
rdoc_options: []
|
90
|
+
require_paths:
|
91
|
+
- lib
|
92
|
+
required_ruby_version: !ruby/object:Gem::Requirement
|
93
|
+
requirements:
|
94
|
+
- - ">="
|
95
|
+
- !ruby/object:Gem::Version
|
96
|
+
version: '0'
|
97
|
+
required_rubygems_version: !ruby/object:Gem::Requirement
|
98
|
+
requirements:
|
99
|
+
- - ">="
|
100
|
+
- !ruby/object:Gem::Version
|
101
|
+
version: '0'
|
102
|
+
requirements: []
|
103
|
+
rubyforge_project:
|
104
|
+
rubygems_version: 2.5.1
|
105
|
+
signing_key:
|
106
|
+
specification_version: 4
|
107
|
+
summary: Summary of Ishapi.
|
108
|
+
test_files: []
|