rest_in_place_bootstrap_slider 0.0.1
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +7 -0
- data/.gitignore +17 -0
- data/Gemfile +4 -0
- data/LICENSE.txt +22 -0
- data/README.md +58 -0
- data/Rakefile +1 -0
- data/TestApp/.gitignore +16 -0
- data/TestApp/.ruby-version +1 -0
- data/TestApp/Gemfile +51 -0
- data/TestApp/README.rdoc +28 -0
- data/TestApp/Rakefile +6 -0
- data/TestApp/app/assets/images/.keep +0 -0
- data/TestApp/app/assets/javascripts/application.js +18 -0
- data/TestApp/app/assets/javascripts/users.js.coffee +3 -0
- data/TestApp/app/assets/stylesheets/application.css +15 -0
- data/TestApp/app/assets/stylesheets/scaffolds.css.scss +69 -0
- data/TestApp/app/assets/stylesheets/users.css.scss +3 -0
- data/TestApp/app/controllers/application_controller.rb +5 -0
- data/TestApp/app/controllers/concerns/.keep +0 -0
- data/TestApp/app/controllers/users_controller.rb +74 -0
- data/TestApp/app/helpers/application_helper.rb +2 -0
- data/TestApp/app/helpers/users_helper.rb +2 -0
- data/TestApp/app/mailers/.keep +0 -0
- data/TestApp/app/models/.keep +0 -0
- data/TestApp/app/models/concerns/.keep +0 -0
- data/TestApp/app/models/user.rb +2 -0
- data/TestApp/app/views/layouts/application.html.erb +14 -0
- data/TestApp/app/views/users/_form.html.erb +25 -0
- data/TestApp/app/views/users/edit.html.erb +6 -0
- data/TestApp/app/views/users/index.html.erb +29 -0
- data/TestApp/app/views/users/index.json.jbuilder +4 -0
- data/TestApp/app/views/users/new.html.erb +5 -0
- data/TestApp/app/views/users/show.html.erb +30 -0
- data/TestApp/app/views/users/show.json.jbuilder +1 -0
- data/TestApp/bin/bundle +3 -0
- data/TestApp/bin/rails +4 -0
- data/TestApp/bin/rake +4 -0
- data/TestApp/config.ru +4 -0
- data/TestApp/config/application.rb +23 -0
- data/TestApp/config/boot.rb +4 -0
- data/TestApp/config/database.yml +25 -0
- data/TestApp/config/environment.rb +5 -0
- data/TestApp/config/environments/development.rb +29 -0
- data/TestApp/config/environments/production.rb +80 -0
- data/TestApp/config/environments/test.rb +36 -0
- data/TestApp/config/initializers/backtrace_silencers.rb +7 -0
- data/TestApp/config/initializers/filter_parameter_logging.rb +4 -0
- data/TestApp/config/initializers/inflections.rb +16 -0
- data/TestApp/config/initializers/mime_types.rb +5 -0
- data/TestApp/config/initializers/secret_token.rb +12 -0
- data/TestApp/config/initializers/session_store.rb +3 -0
- data/TestApp/config/initializers/wrap_parameters.rb +14 -0
- data/TestApp/config/locales/en.yml +23 -0
- data/TestApp/config/routes.rb +58 -0
- data/TestApp/db/migrate/20140124064041_create_users.rb +10 -0
- data/TestApp/db/schema.rb +23 -0
- data/TestApp/db/seeds.rb +7 -0
- data/TestApp/lib/assets/.keep +0 -0
- data/TestApp/lib/tasks/.keep +0 -0
- data/TestApp/log/.keep +0 -0
- data/TestApp/public/404.html +58 -0
- data/TestApp/public/422.html +58 -0
- data/TestApp/public/500.html +57 -0
- data/TestApp/public/favicon.ico +0 -0
- data/TestApp/public/robots.txt +5 -0
- data/TestApp/test/controllers/.keep +0 -0
- data/TestApp/test/controllers/users_controller_test.rb +49 -0
- data/TestApp/test/fixtures/.keep +0 -0
- data/TestApp/test/fixtures/users.yml +9 -0
- data/TestApp/test/helpers/.keep +0 -0
- data/TestApp/test/helpers/users_helper_test.rb +4 -0
- data/TestApp/test/integration/.keep +0 -0
- data/TestApp/test/mailers/.keep +0 -0
- data/TestApp/test/models/.keep +0 -0
- data/TestApp/test/models/user_test.rb +7 -0
- data/TestApp/test/test_helper.rb +15 -0
- data/TestApp/vendor/assets/javascripts/.keep +0 -0
- data/TestApp/vendor/assets/stylesheets/.keep +0 -0
- data/lib/assets/javascripts/rest_in_place_bootstrap_slider/index.js.coffee +3 -0
- data/lib/assets/javascripts/rest_in_place_bootstrap_slider/rest_in_place_bootstrap_slider.js.coffee +51 -0
- data/lib/assets/stylesheets/rest_in_place_bootstrap_slider/index.css.scss +3 -0
- data/lib/rest_in_place_bootstrap_slider.rb +8 -0
- data/lib/rest_in_place_bootstrap_slider/version.rb +3 -0
- data/rest_in_place_bootstrap_slider.gemspec +27 -0
- metadata +197 -0
checksums.yaml
ADDED
@@ -0,0 +1,7 @@
|
|
1
|
+
---
|
2
|
+
SHA1:
|
3
|
+
metadata.gz: 9da617c3ce664f4c7336a615ee4c87c28ec2fd79
|
4
|
+
data.tar.gz: c48dfd971fd30099a91915db61923eea0d131070
|
5
|
+
SHA512:
|
6
|
+
metadata.gz: 76f62a072ba3533b566b99c8751c5d36bcf0d54c0f10127e43184bd626f0f05b94f44b5716dd10b64de473c2014b81e3bdff746a6c1b36133ea4f1538b1660c0
|
7
|
+
data.tar.gz: 56c2c86263e1d9c7ac259c61367f868a5903d5a0b66f7586fc070ee476920a7e6d5d9f5759cdd2aa96b7bcb0757dbfb831a0df2380840c9689a3e87f5281e3c2
|
data/.gitignore
ADDED
data/Gemfile
ADDED
data/LICENSE.txt
ADDED
@@ -0,0 +1,22 @@
|
|
1
|
+
Copyright (c) 2014 Jens Bissinger
|
2
|
+
|
3
|
+
MIT License
|
4
|
+
|
5
|
+
Permission is hereby granted, free of charge, to any person obtaining
|
6
|
+
a copy of this software and associated documentation files (the
|
7
|
+
"Software"), to deal in the Software without restriction, including
|
8
|
+
without limitation the rights to use, copy, modify, merge, publish,
|
9
|
+
distribute, sublicense, and/or sell copies of the Software, and to
|
10
|
+
permit persons to whom the Software is furnished to do so, subject to
|
11
|
+
the following conditions:
|
12
|
+
|
13
|
+
The above copyright notice and this permission notice shall be
|
14
|
+
included in all copies or substantial portions of the Software.
|
15
|
+
|
16
|
+
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND,
|
17
|
+
EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF
|
18
|
+
MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND
|
19
|
+
NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE
|
20
|
+
LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION
|
21
|
+
OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION
|
22
|
+
WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
|
data/README.md
ADDED
@@ -0,0 +1,58 @@
|
|
1
|
+
# RestInPlaceBootstrapSlider
|
2
|
+
|
3
|
+
An AJAX Inplace-Editor + Bootstrap-Slider for the Rails 3.1+ asset pipeline.
|
4
|
+
|
5
|
+
## Requirements
|
6
|
+
|
7
|
+
The following gems are unique and hard dependencies that will be installed automatically:
|
8
|
+
|
9
|
+
* [rest_in_place](http://github.com/janv/rest_in_place/)
|
10
|
+
* [bootstrap-slider-rails](https://github.com/utahstreetlabs/bootstrap-slider-rails)
|
11
|
+
|
12
|
+
For the styling of the slider you'll need to setup a proper twitter bootstrap environment. I recommend using the following gem:
|
13
|
+
|
14
|
+
* [bootstrap-sass](https://github.com/twbs/bootstrap-sass)
|
15
|
+
|
16
|
+
## Installation
|
17
|
+
|
18
|
+
Add this lines to your application's Gemfile:
|
19
|
+
|
20
|
+
gem 'rest_in_place_bootstrap_slider'
|
21
|
+
|
22
|
+
gem 'bootstrap-sass' # or any other bootstrap gem
|
23
|
+
|
24
|
+
And then execute:
|
25
|
+
|
26
|
+
$ bundle
|
27
|
+
|
28
|
+
Or install it yourself as:
|
29
|
+
|
30
|
+
$ gem install rest_in_place_bootstrap_slider
|
31
|
+
|
32
|
+
Example `application.js.coffee`:
|
33
|
+
|
34
|
+
//= require bootstrap
|
35
|
+
//= require rest_in_place_bootstrap_slider
|
36
|
+
|
37
|
+
Example `application.css.scss`:
|
38
|
+
|
39
|
+
/*
|
40
|
+
*= require bootstrap
|
41
|
+
*= require rest_in_place_bootstrap_slider
|
42
|
+
*/
|
43
|
+
|
44
|
+
## Usage
|
45
|
+
|
46
|
+
TODO: Write usage instructions here
|
47
|
+
|
48
|
+
## Contributing
|
49
|
+
|
50
|
+
1. Fork it
|
51
|
+
2. Create your feature branch (`git checkout -b my-new-feature`)
|
52
|
+
3. Commit your changes (`git commit -am 'Add some feature'`)
|
53
|
+
4. Push to the branch (`git push origin my-new-feature`)
|
54
|
+
5. Create new Pull Request
|
55
|
+
|
56
|
+
## License
|
57
|
+
|
58
|
+
Copyright (c) 2014 Jens Bissinger. See [MIT-LICENSE](LICENSE.txt).
|
data/Rakefile
ADDED
@@ -0,0 +1 @@
|
|
1
|
+
require "bundler/gem_tasks"
|
data/TestApp/.gitignore
ADDED
@@ -0,0 +1,16 @@
|
|
1
|
+
# See https://help.github.com/articles/ignoring-files for more about ignoring files.
|
2
|
+
#
|
3
|
+
# If you find yourself ignoring temporary files generated by your text editor
|
4
|
+
# or operating system, you probably want to add a global ignore instead:
|
5
|
+
# git config --global core.excludesfile '~/.gitignore_global'
|
6
|
+
|
7
|
+
# Ignore bundler config.
|
8
|
+
/.bundle
|
9
|
+
|
10
|
+
# Ignore the default SQLite database.
|
11
|
+
/db/*.sqlite3
|
12
|
+
/db/*.sqlite3-journal
|
13
|
+
|
14
|
+
# Ignore all logfiles and tempfiles.
|
15
|
+
/log/*.log
|
16
|
+
/tmp
|
@@ -0,0 +1 @@
|
|
1
|
+
2
|
data/TestApp/Gemfile
ADDED
@@ -0,0 +1,51 @@
|
|
1
|
+
source 'https://rubygems.org'
|
2
|
+
|
3
|
+
# Bundle edge Rails instead: gem 'rails', github: 'rails/rails'
|
4
|
+
gem 'rails', '4.0.2'
|
5
|
+
|
6
|
+
# The slider gem
|
7
|
+
gem 'rest_in_place_bootstrap_slider', path: '..'
|
8
|
+
|
9
|
+
# Just as an example
|
10
|
+
gem 'bootstrap-sass'
|
11
|
+
|
12
|
+
# Use sqlite3 as the database for Active Record
|
13
|
+
gem 'sqlite3'
|
14
|
+
|
15
|
+
# Use SCSS for stylesheets
|
16
|
+
gem 'sass-rails', '~> 4.0.0'
|
17
|
+
|
18
|
+
# Use Uglifier as compressor for JavaScript assets
|
19
|
+
gem 'uglifier', '>= 1.3.0'
|
20
|
+
|
21
|
+
# Use CoffeeScript for .js.coffee assets and views
|
22
|
+
gem 'coffee-rails', '~> 4.0.0'
|
23
|
+
|
24
|
+
# See https://github.com/sstephenson/execjs#readme for more supported runtimes
|
25
|
+
# gem 'therubyracer', platforms: :ruby
|
26
|
+
|
27
|
+
# Use jquery as the JavaScript library
|
28
|
+
gem 'jquery-rails'
|
29
|
+
|
30
|
+
# Turbolinks makes following links in your web application faster. Read more: https://github.com/rails/turbolinks
|
31
|
+
gem 'turbolinks'
|
32
|
+
|
33
|
+
# Build JSON APIs with ease. Read more: https://github.com/rails/jbuilder
|
34
|
+
gem 'jbuilder', '~> 1.2'
|
35
|
+
|
36
|
+
group :doc do
|
37
|
+
# bundle exec rake doc:rails generates the API under doc/api.
|
38
|
+
gem 'sdoc', require: false
|
39
|
+
end
|
40
|
+
|
41
|
+
# Use ActiveModel has_secure_password
|
42
|
+
# gem 'bcrypt-ruby', '~> 3.1.2'
|
43
|
+
|
44
|
+
# Use unicorn as the app server
|
45
|
+
# gem 'unicorn'
|
46
|
+
|
47
|
+
# Use Capistrano for deployment
|
48
|
+
# gem 'capistrano', group: :development
|
49
|
+
|
50
|
+
# Use debugger
|
51
|
+
# gem 'debugger', group: [:development, :test]
|
data/TestApp/README.rdoc
ADDED
@@ -0,0 +1,28 @@
|
|
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
|
+
* ...
|
25
|
+
|
26
|
+
|
27
|
+
Please feel free to use a different markup language if you do not plan to run
|
28
|
+
<tt>rake doc:app</tt>.
|
data/TestApp/Rakefile
ADDED
File without changes
|
@@ -0,0 +1,18 @@
|
|
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 vendor/assets/javascripts of plugins, if any, 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.
|
9
|
+
//
|
10
|
+
// Read Sprockets README (https://github.com/sstephenson/sprockets#sprockets-directives) for details
|
11
|
+
// about supported directives.
|
12
|
+
//
|
13
|
+
//= require jquery
|
14
|
+
//= require jquery_ujs
|
15
|
+
//= require turbolinks
|
16
|
+
//= require bootstrap
|
17
|
+
//= require rest_in_place_bootstrap_slider
|
18
|
+
//= 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 vendor/assets/stylesheets of plugins, if any, 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 top of the
|
9
|
+
* compiled file, but it's generally better to create a new file per style scope.
|
10
|
+
*
|
11
|
+
*= require bootstrap
|
12
|
+
*= require rest_in_place_bootstrap_slider
|
13
|
+
*= require_self
|
14
|
+
*= require_tree .
|
15
|
+
*/
|
@@ -0,0 +1,69 @@
|
|
1
|
+
body {
|
2
|
+
background-color: #fff;
|
3
|
+
color: #333;
|
4
|
+
font-family: verdana, arial, helvetica, sans-serif;
|
5
|
+
font-size: 13px;
|
6
|
+
line-height: 18px;
|
7
|
+
}
|
8
|
+
|
9
|
+
p, ol, ul, td {
|
10
|
+
font-family: verdana, arial, helvetica, sans-serif;
|
11
|
+
font-size: 13px;
|
12
|
+
line-height: 18px;
|
13
|
+
}
|
14
|
+
|
15
|
+
pre {
|
16
|
+
background-color: #eee;
|
17
|
+
padding: 10px;
|
18
|
+
font-size: 11px;
|
19
|
+
}
|
20
|
+
|
21
|
+
a {
|
22
|
+
color: #000;
|
23
|
+
&:visited {
|
24
|
+
color: #666;
|
25
|
+
}
|
26
|
+
&:hover {
|
27
|
+
color: #fff;
|
28
|
+
background-color: #000;
|
29
|
+
}
|
30
|
+
}
|
31
|
+
|
32
|
+
div {
|
33
|
+
&.field, &.actions {
|
34
|
+
margin-bottom: 10px;
|
35
|
+
}
|
36
|
+
}
|
37
|
+
|
38
|
+
#notice {
|
39
|
+
color: green;
|
40
|
+
}
|
41
|
+
|
42
|
+
.field_with_errors {
|
43
|
+
padding: 2px;
|
44
|
+
background-color: red;
|
45
|
+
display: table;
|
46
|
+
}
|
47
|
+
|
48
|
+
#error_explanation {
|
49
|
+
width: 450px;
|
50
|
+
border: 2px solid red;
|
51
|
+
padding: 7px;
|
52
|
+
padding-bottom: 0;
|
53
|
+
margin-bottom: 20px;
|
54
|
+
background-color: #f0f0f0;
|
55
|
+
h2 {
|
56
|
+
text-align: left;
|
57
|
+
font-weight: bold;
|
58
|
+
padding: 5px 5px 5px 15px;
|
59
|
+
font-size: 12px;
|
60
|
+
margin: -7px;
|
61
|
+
margin-bottom: 0px;
|
62
|
+
background-color: #c00;
|
63
|
+
color: #fff;
|
64
|
+
}
|
65
|
+
ul li {
|
66
|
+
font-size: 12px;
|
67
|
+
list-style: square;
|
68
|
+
}
|
69
|
+
}
|
File without changes
|
@@ -0,0 +1,74 @@
|
|
1
|
+
class UsersController < ApplicationController
|
2
|
+
before_action :set_user, only: [:show, :edit, :update, :destroy]
|
3
|
+
|
4
|
+
# GET /users
|
5
|
+
# GET /users.json
|
6
|
+
def index
|
7
|
+
@users = User.all
|
8
|
+
end
|
9
|
+
|
10
|
+
# GET /users/1
|
11
|
+
# GET /users/1.json
|
12
|
+
def show
|
13
|
+
end
|
14
|
+
|
15
|
+
# GET /users/new
|
16
|
+
def new
|
17
|
+
@user = User.new
|
18
|
+
end
|
19
|
+
|
20
|
+
# GET /users/1/edit
|
21
|
+
def edit
|
22
|
+
end
|
23
|
+
|
24
|
+
# POST /users
|
25
|
+
# POST /users.json
|
26
|
+
def create
|
27
|
+
@user = User.new(user_params)
|
28
|
+
|
29
|
+
respond_to do |format|
|
30
|
+
if @user.save
|
31
|
+
format.html { redirect_to @user, notice: 'User was successfully created.' }
|
32
|
+
format.json { render action: 'show', status: :created, location: @user }
|
33
|
+
else
|
34
|
+
format.html { render action: 'new' }
|
35
|
+
format.json { render json: @user.errors, status: :unprocessable_entity }
|
36
|
+
end
|
37
|
+
end
|
38
|
+
end
|
39
|
+
|
40
|
+
# PATCH/PUT /users/1
|
41
|
+
# PATCH/PUT /users/1.json
|
42
|
+
def update
|
43
|
+
respond_to do |format|
|
44
|
+
if @user.update(user_params)
|
45
|
+
format.html { redirect_to @user, notice: 'User was successfully updated.' }
|
46
|
+
format.json { head :no_content }
|
47
|
+
else
|
48
|
+
format.html { render action: 'edit' }
|
49
|
+
format.json { render json: @user.errors, status: :unprocessable_entity }
|
50
|
+
end
|
51
|
+
end
|
52
|
+
end
|
53
|
+
|
54
|
+
# DELETE /users/1
|
55
|
+
# DELETE /users/1.json
|
56
|
+
def destroy
|
57
|
+
@user.destroy
|
58
|
+
respond_to do |format|
|
59
|
+
format.html { redirect_to users_url }
|
60
|
+
format.json { head :no_content }
|
61
|
+
end
|
62
|
+
end
|
63
|
+
|
64
|
+
private
|
65
|
+
# Use callbacks to share common setup or constraints between actions.
|
66
|
+
def set_user
|
67
|
+
@user = User.find(params[:id])
|
68
|
+
end
|
69
|
+
|
70
|
+
# Never trust parameters from the scary internet, only allow the white list through.
|
71
|
+
def user_params
|
72
|
+
params.require(:user).permit(:name, :age)
|
73
|
+
end
|
74
|
+
end
|