friendly_slug 0.1.6 → 0.1.7
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.
- checksums.yaml +4 -4
- data/README.md +1 -1
- data/friendly_slug.gemspec +1 -1
- data/lib/friendly_slug/version.rb +1 -1
- metadata +1 -119
- data/friendly_slug_gem_test/.gitignore +0 -30
- data/friendly_slug_gem_test/.ruby-version +0 -1
- data/friendly_slug_gem_test/Gemfile +0 -32
- data/friendly_slug_gem_test/Gemfile.lock +0 -222
- data/friendly_slug_gem_test/README.md +0 -24
- data/friendly_slug_gem_test/Rakefile +0 -6
- data/friendly_slug_gem_test/app/assets/config/manifest.js +0 -3
- data/friendly_slug_gem_test/app/assets/images/.keep +0 -0
- data/friendly_slug_gem_test/app/assets/javascripts/application.js +0 -16
- data/friendly_slug_gem_test/app/assets/javascripts/blogs.coffee +0 -3
- data/friendly_slug_gem_test/app/assets/javascripts/cable.js +0 -13
- data/friendly_slug_gem_test/app/assets/javascripts/channels/.keep +0 -0
- data/friendly_slug_gem_test/app/assets/javascripts/topics.coffee +0 -3
- data/friendly_slug_gem_test/app/assets/stylesheets/application.css +0 -15
- data/friendly_slug_gem_test/app/assets/stylesheets/blogs.scss +0 -3
- data/friendly_slug_gem_test/app/assets/stylesheets/scaffolds.scss +0 -84
- data/friendly_slug_gem_test/app/assets/stylesheets/topics.scss +0 -3
- data/friendly_slug_gem_test/app/channels/application_cable/channel.rb +0 -4
- data/friendly_slug_gem_test/app/channels/application_cable/connection.rb +0 -4
- data/friendly_slug_gem_test/app/controllers/application_controller.rb +0 -2
- data/friendly_slug_gem_test/app/controllers/blogs_controller.rb +0 -60
- data/friendly_slug_gem_test/app/controllers/concerns/.keep +0 -0
- data/friendly_slug_gem_test/app/controllers/topics_controller.rb +0 -60
- data/friendly_slug_gem_test/app/helpers/application_helper.rb +0 -2
- data/friendly_slug_gem_test/app/helpers/blogs_helper.rb +0 -2
- data/friendly_slug_gem_test/app/helpers/topics_helper.rb +0 -2
- data/friendly_slug_gem_test/app/jobs/application_job.rb +0 -2
- data/friendly_slug_gem_test/app/mailers/application_mailer.rb +0 -4
- data/friendly_slug_gem_test/app/models/application_record.rb +0 -3
- data/friendly_slug_gem_test/app/models/blog.rb +0 -3
- data/friendly_slug_gem_test/app/models/concerns/.keep +0 -0
- data/friendly_slug_gem_test/app/models/topic.rb +0 -3
- data/friendly_slug_gem_test/app/views/blogs/_blog.json.jbuilder +0 -2
- data/friendly_slug_gem_test/app/views/blogs/_form.html.erb +0 -32
- data/friendly_slug_gem_test/app/views/blogs/edit.html.erb +0 -6
- data/friendly_slug_gem_test/app/views/blogs/index.html.erb +0 -31
- data/friendly_slug_gem_test/app/views/blogs/index.json.jbuilder +0 -1
- data/friendly_slug_gem_test/app/views/blogs/new.html.erb +0 -5
- data/friendly_slug_gem_test/app/views/blogs/show.html.erb +0 -19
- data/friendly_slug_gem_test/app/views/blogs/show.json.jbuilder +0 -1
- data/friendly_slug_gem_test/app/views/layouts/application.html.erb +0 -15
- data/friendly_slug_gem_test/app/views/layouts/mailer.html.erb +0 -13
- data/friendly_slug_gem_test/app/views/layouts/mailer.text.erb +0 -1
- data/friendly_slug_gem_test/app/views/topics/_form.html.erb +0 -37
- data/friendly_slug_gem_test/app/views/topics/_topic.json.jbuilder +0 -2
- data/friendly_slug_gem_test/app/views/topics/edit.html.erb +0 -6
- data/friendly_slug_gem_test/app/views/topics/index.html.erb +0 -33
- data/friendly_slug_gem_test/app/views/topics/index.json.jbuilder +0 -1
- data/friendly_slug_gem_test/app/views/topics/new.html.erb +0 -5
- data/friendly_slug_gem_test/app/views/topics/show.html.erb +0 -24
- data/friendly_slug_gem_test/app/views/topics/show.json.jbuilder +0 -1
- data/friendly_slug_gem_test/bin/bundle +0 -3
- data/friendly_slug_gem_test/bin/rails +0 -9
- data/friendly_slug_gem_test/bin/rake +0 -9
- data/friendly_slug_gem_test/bin/setup +0 -36
- data/friendly_slug_gem_test/bin/spring +0 -17
- data/friendly_slug_gem_test/bin/update +0 -31
- data/friendly_slug_gem_test/bin/yarn +0 -11
- data/friendly_slug_gem_test/config.ru +0 -5
- data/friendly_slug_gem_test/config/application.rb +0 -20
- data/friendly_slug_gem_test/config/boot.rb +0 -4
- data/friendly_slug_gem_test/config/cable.yml +0 -10
- data/friendly_slug_gem_test/config/credentials.yml.enc +0 -1
- data/friendly_slug_gem_test/config/database.yml +0 -25
- data/friendly_slug_gem_test/config/environment.rb +0 -5
- data/friendly_slug_gem_test/config/environments/development.rb +0 -61
- data/friendly_slug_gem_test/config/environments/production.rb +0 -94
- data/friendly_slug_gem_test/config/environments/test.rb +0 -46
- data/friendly_slug_gem_test/config/initializers/application_controller_renderer.rb +0 -8
- data/friendly_slug_gem_test/config/initializers/assets.rb +0 -14
- data/friendly_slug_gem_test/config/initializers/backtrace_silencers.rb +0 -7
- data/friendly_slug_gem_test/config/initializers/content_security_policy.rb +0 -25
- data/friendly_slug_gem_test/config/initializers/cookies_serializer.rb +0 -5
- data/friendly_slug_gem_test/config/initializers/filter_parameter_logging.rb +0 -4
- data/friendly_slug_gem_test/config/initializers/inflections.rb +0 -16
- data/friendly_slug_gem_test/config/initializers/mime_types.rb +0 -4
- data/friendly_slug_gem_test/config/initializers/wrap_parameters.rb +0 -14
- data/friendly_slug_gem_test/config/locales/en.yml +0 -33
- data/friendly_slug_gem_test/config/puma.rb +0 -34
- data/friendly_slug_gem_test/config/routes.rb +0 -5
- data/friendly_slug_gem_test/config/spring.rb +0 -6
- data/friendly_slug_gem_test/config/storage.yml +0 -34
- data/friendly_slug_gem_test/db/migrate/20180628233122_create_blogs.rb +0 -11
- data/friendly_slug_gem_test/db/migrate/20180630053922_create_topics.rb +0 -13
- data/friendly_slug_gem_test/db/schema.rb +0 -33
- data/friendly_slug_gem_test/db/seeds.rb +0 -9
- data/friendly_slug_gem_test/lib/assets/.keep +0 -0
- data/friendly_slug_gem_test/lib/tasks/.keep +0 -0
- data/friendly_slug_gem_test/log/.keep +0 -0
- data/friendly_slug_gem_test/package.json +0 -5
- data/friendly_slug_gem_test/public/404.html +0 -67
- data/friendly_slug_gem_test/public/422.html +0 -67
- data/friendly_slug_gem_test/public/500.html +0 -66
- data/friendly_slug_gem_test/public/apple-touch-icon-precomposed.png +0 -0
- data/friendly_slug_gem_test/public/apple-touch-icon.png +0 -0
- data/friendly_slug_gem_test/public/favicon.ico +0 -0
- data/friendly_slug_gem_test/public/robots.txt +0 -1
- data/friendly_slug_gem_test/test/application_system_test_case.rb +0 -5
- data/friendly_slug_gem_test/test/controllers/.keep +0 -0
- data/friendly_slug_gem_test/test/controllers/blogs_controller_test.rb +0 -48
- data/friendly_slug_gem_test/test/controllers/topics_controller_test.rb +0 -48
- data/friendly_slug_gem_test/test/fixtures/.keep +0 -0
- data/friendly_slug_gem_test/test/fixtures/blogs.yml +0 -17
- data/friendly_slug_gem_test/test/fixtures/files/.keep +0 -0
- data/friendly_slug_gem_test/test/fixtures/topics.yml +0 -27
- data/friendly_slug_gem_test/test/helpers/.keep +0 -0
- data/friendly_slug_gem_test/test/integration/.keep +0 -0
- data/friendly_slug_gem_test/test/integration/main_slug_test.rb +0 -34
- data/friendly_slug_gem_test/test/mailers/.keep +0 -0
- data/friendly_slug_gem_test/test/models/.keep +0 -0
- data/friendly_slug_gem_test/test/models/blog_test.rb +0 -19
- data/friendly_slug_gem_test/test/models/topic_test.rb +0 -18
- data/friendly_slug_gem_test/test/system/.keep +0 -0
- data/friendly_slug_gem_test/test/system/blogs_test.rb +0 -47
- data/friendly_slug_gem_test/test/system/topics_test.rb +0 -49
- data/friendly_slug_gem_test/test/test_helper.rb +0 -37
- data/friendly_slug_gem_test/tmp/.keep +0 -0
- data/friendly_slug_gem_test/vendor/.keep +0 -0
@@ -1,24 +0,0 @@
|
|
1
|
-
# README
|
2
|
-
|
3
|
-
This README would normally document whatever steps are necessary to get the
|
4
|
-
application up and running.
|
5
|
-
|
6
|
-
Things you may want to cover:
|
7
|
-
|
8
|
-
* Ruby version
|
9
|
-
|
10
|
-
* System dependencies
|
11
|
-
|
12
|
-
* Configuration
|
13
|
-
|
14
|
-
* Database creation
|
15
|
-
|
16
|
-
* Database initialization
|
17
|
-
|
18
|
-
* How to run the test suite
|
19
|
-
|
20
|
-
* Services (job queues, cache servers, search engines, etc.)
|
21
|
-
|
22
|
-
* Deployment instructions
|
23
|
-
|
24
|
-
* ...
|
File without changes
|
@@ -1,16 +0,0 @@
|
|
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, or any plugin's
|
5
|
-
// 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 rails-ujs
|
14
|
-
//= require activestorage
|
15
|
-
//= require turbolinks
|
16
|
-
//= require_tree .
|
@@ -1,13 +0,0 @@
|
|
1
|
-
// Action Cable provides the framework to deal with WebSockets in Rails.
|
2
|
-
// You can generate new channels where WebSocket features live using the `rails generate channel` command.
|
3
|
-
//
|
4
|
-
//= require action_cable
|
5
|
-
//= require_self
|
6
|
-
//= require_tree ./channels
|
7
|
-
|
8
|
-
(function() {
|
9
|
-
this.App || (this.App = {});
|
10
|
-
|
11
|
-
App.cable = ActionCable.createConsumer();
|
12
|
-
|
13
|
-
}).call(this);
|
File without changes
|
@@ -1,15 +0,0 @@
|
|
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, or any plugin's
|
6
|
-
* 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
|
-
*/
|
@@ -1,84 +0,0 @@
|
|
1
|
-
body {
|
2
|
-
background-color: #fff;
|
3
|
-
color: #333;
|
4
|
-
margin: 33px;
|
5
|
-
font-family: verdana, arial, helvetica, sans-serif;
|
6
|
-
font-size: 13px;
|
7
|
-
line-height: 18px;
|
8
|
-
}
|
9
|
-
|
10
|
-
p, ol, ul, td {
|
11
|
-
font-family: verdana, arial, helvetica, sans-serif;
|
12
|
-
font-size: 13px;
|
13
|
-
line-height: 18px;
|
14
|
-
}
|
15
|
-
|
16
|
-
pre {
|
17
|
-
background-color: #eee;
|
18
|
-
padding: 10px;
|
19
|
-
font-size: 11px;
|
20
|
-
}
|
21
|
-
|
22
|
-
a {
|
23
|
-
color: #000;
|
24
|
-
|
25
|
-
&:visited {
|
26
|
-
color: #666;
|
27
|
-
}
|
28
|
-
|
29
|
-
&:hover {
|
30
|
-
color: #fff;
|
31
|
-
background-color: #000;
|
32
|
-
}
|
33
|
-
}
|
34
|
-
|
35
|
-
th {
|
36
|
-
padding-bottom: 5px;
|
37
|
-
}
|
38
|
-
|
39
|
-
td {
|
40
|
-
padding: 0 5px 7px;
|
41
|
-
}
|
42
|
-
|
43
|
-
div {
|
44
|
-
&.field, &.actions {
|
45
|
-
margin-bottom: 10px;
|
46
|
-
}
|
47
|
-
}
|
48
|
-
|
49
|
-
#notice {
|
50
|
-
color: green;
|
51
|
-
}
|
52
|
-
|
53
|
-
.field_with_errors {
|
54
|
-
padding: 2px;
|
55
|
-
background-color: red;
|
56
|
-
display: table;
|
57
|
-
}
|
58
|
-
|
59
|
-
#error_explanation {
|
60
|
-
width: 450px;
|
61
|
-
border: 2px solid red;
|
62
|
-
padding: 7px 7px 0;
|
63
|
-
margin-bottom: 20px;
|
64
|
-
background-color: #f0f0f0;
|
65
|
-
|
66
|
-
h2 {
|
67
|
-
text-align: left;
|
68
|
-
font-weight: bold;
|
69
|
-
padding: 5px 5px 5px 15px;
|
70
|
-
font-size: 12px;
|
71
|
-
margin: -7px -7px 0;
|
72
|
-
background-color: #c00;
|
73
|
-
color: #fff;
|
74
|
-
}
|
75
|
-
|
76
|
-
ul li {
|
77
|
-
font-size: 12px;
|
78
|
-
list-style: square;
|
79
|
-
}
|
80
|
-
}
|
81
|
-
|
82
|
-
label {
|
83
|
-
display: block;
|
84
|
-
}
|
@@ -1,60 +0,0 @@
|
|
1
|
-
class BlogsController < ApplicationController
|
2
|
-
before_action :set_blog, only: [:show, :edit, :update, :destroy]
|
3
|
-
|
4
|
-
def index
|
5
|
-
@blogs = Blog.all
|
6
|
-
end
|
7
|
-
|
8
|
-
def show
|
9
|
-
end
|
10
|
-
|
11
|
-
def new
|
12
|
-
@blog = Blog.new
|
13
|
-
end
|
14
|
-
|
15
|
-
def edit
|
16
|
-
end
|
17
|
-
|
18
|
-
def create
|
19
|
-
@blog = Blog.new(blog_params)
|
20
|
-
|
21
|
-
respond_to do |format|
|
22
|
-
if @blog.save
|
23
|
-
format.html { redirect_to @blog, notice: 'Blog was successfully created.' }
|
24
|
-
format.json { render :show, status: :created, location: @blog }
|
25
|
-
else
|
26
|
-
format.html { render :new }
|
27
|
-
format.json { render json: @blog.errors, status: :unprocessable_entity }
|
28
|
-
end
|
29
|
-
end
|
30
|
-
end
|
31
|
-
|
32
|
-
def update
|
33
|
-
respond_to do |format|
|
34
|
-
if @blog.update(blog_params)
|
35
|
-
format.html { redirect_to @blog, notice: 'Blog was successfully updated.' }
|
36
|
-
format.json { render :show, status: :ok, location: @blog }
|
37
|
-
else
|
38
|
-
format.html { render :edit }
|
39
|
-
format.json { render json: @blog.errors, status: :unprocessable_entity }
|
40
|
-
end
|
41
|
-
end
|
42
|
-
end
|
43
|
-
|
44
|
-
def destroy
|
45
|
-
@blog.destroy
|
46
|
-
respond_to do |format|
|
47
|
-
format.html { redirect_to blogs_url, notice: 'Blog was successfully destroyed.' }
|
48
|
-
format.json { head :no_content }
|
49
|
-
end
|
50
|
-
end
|
51
|
-
|
52
|
-
private
|
53
|
-
def set_blog
|
54
|
-
@blog = Blog.find_slugged(params[:id])
|
55
|
-
end
|
56
|
-
|
57
|
-
def blog_params
|
58
|
-
params.require(:blog).permit(:title, :body, :views)
|
59
|
-
end
|
60
|
-
end
|
File without changes
|
@@ -1,60 +0,0 @@
|
|
1
|
-
class TopicsController < ApplicationController
|
2
|
-
before_action :set_topic, only: [:show, :edit, :update, :destroy]
|
3
|
-
|
4
|
-
def index
|
5
|
-
@topics = Topic.all
|
6
|
-
end
|
7
|
-
|
8
|
-
def show
|
9
|
-
end
|
10
|
-
|
11
|
-
def new
|
12
|
-
@topic = Topic.new
|
13
|
-
end
|
14
|
-
|
15
|
-
def edit
|
16
|
-
end
|
17
|
-
|
18
|
-
def create
|
19
|
-
@topic = Topic.new(topic_params)
|
20
|
-
|
21
|
-
respond_to do |format|
|
22
|
-
if @topic.save
|
23
|
-
format.html { redirect_to @topic, notice: 'Topic was successfully created.' }
|
24
|
-
format.json { render :show, status: :created, location: @topic }
|
25
|
-
else
|
26
|
-
format.html { render :new }
|
27
|
-
format.json { render json: @topic.errors, status: :unprocessable_entity }
|
28
|
-
end
|
29
|
-
end
|
30
|
-
end
|
31
|
-
|
32
|
-
def update
|
33
|
-
respond_to do |format|
|
34
|
-
if @topic.update(topic_params)
|
35
|
-
format.html { redirect_to @topic, notice: 'Topic was successfully updated.' }
|
36
|
-
format.json { render :show, status: :ok, location: @topic }
|
37
|
-
else
|
38
|
-
format.html { render :edit }
|
39
|
-
format.json { render json: @topic.errors, status: :unprocessable_entity }
|
40
|
-
end
|
41
|
-
end
|
42
|
-
end
|
43
|
-
|
44
|
-
def destroy
|
45
|
-
@topic.destroy
|
46
|
-
respond_to do |format|
|
47
|
-
format.html { redirect_to topics_url, notice: 'Topic was successfully destroyed.' }
|
48
|
-
format.json { head :no_content }
|
49
|
-
end
|
50
|
-
end
|
51
|
-
|
52
|
-
private
|
53
|
-
def set_topic
|
54
|
-
@topic = Topic.find_by_slug(params[:id])
|
55
|
-
end
|
56
|
-
|
57
|
-
def topic_params
|
58
|
-
params.require(:topic).permit(:title, :slug, :color, :views)
|
59
|
-
end
|
60
|
-
end
|
File without changes
|
@@ -1,32 +0,0 @@
|
|
1
|
-
<%= form_with(model: blog, local: true) do |form| %>
|
2
|
-
<% if blog.errors.any? %>
|
3
|
-
<div id="error_explanation">
|
4
|
-
<h2><%= pluralize(blog.errors.count, "error") %> prohibited this blog from being saved:</h2>
|
5
|
-
|
6
|
-
<ul>
|
7
|
-
<% blog.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 %>
|
17
|
-
</div>
|
18
|
-
|
19
|
-
<div class="field">
|
20
|
-
<%= form.label :body %>
|
21
|
-
<%= form.text_area :body %>
|
22
|
-
</div>
|
23
|
-
|
24
|
-
<div class="field">
|
25
|
-
<%= form.label :views %>
|
26
|
-
<%= form.text_field :views %>
|
27
|
-
</div>
|
28
|
-
|
29
|
-
<div class="actions">
|
30
|
-
<%= form.submit %>
|
31
|
-
</div>
|
32
|
-
<% end %>
|
@@ -1,31 +0,0 @@
|
|
1
|
-
<p id="notice"><%= notice %></p>
|
2
|
-
|
3
|
-
<h1>Blogs</h1>
|
4
|
-
|
5
|
-
<table>
|
6
|
-
<thead>
|
7
|
-
<tr>
|
8
|
-
<th>Title</th>
|
9
|
-
<th>Body</th>
|
10
|
-
<th>Views</th>
|
11
|
-
<th colspan="3"></th>
|
12
|
-
</tr>
|
13
|
-
</thead>
|
14
|
-
|
15
|
-
<tbody>
|
16
|
-
<% @blogs.each do |blog| %>
|
17
|
-
<tr>
|
18
|
-
<td><%= blog.title %></td>
|
19
|
-
<td><%= blog.body %></td>
|
20
|
-
<td><%= blog.views %></td>
|
21
|
-
<td><%= link_to 'Show', blog %></td>
|
22
|
-
<td><%= link_to 'Edit', edit_blog_path(blog) %></td>
|
23
|
-
<td><%= link_to 'Destroy', blog, method: :delete, data: { confirm: 'Are you sure?' } %></td>
|
24
|
-
</tr>
|
25
|
-
<% end %>
|
26
|
-
</tbody>
|
27
|
-
</table>
|
28
|
-
|
29
|
-
<br>
|
30
|
-
|
31
|
-
<%= link_to 'New Blog', new_blog_path %>
|