best_in_place 2.1.0 → 3.0.0.rc1
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +7 -0
- data/.gitignore +7 -5
- data/.rspec +1 -0
- data/.travis.yml +12 -5
- data/Appraisals +17 -0
- data/CHANGELOG.md +51 -30
- data/Gemfile +15 -2
- data/README.md +52 -105
- data/best_in_place.gemspec +13 -11
- data/config.ru +7 -0
- data/gemfiles/rails_3.2.gemfile +24 -0
- data/gemfiles/rails_4.0.gemfile +23 -0
- data/gemfiles/rails_4.1.gemfile +23 -0
- data/gemfiles/rails_edge.gemfile +25 -0
- data/lib/assets/javascripts/best_in_place.jquery-ui.js +57 -0
- data/lib/assets/javascripts/best_in_place.js +551 -650
- data/lib/assets/javascripts/best_in_place.purr.js +16 -6
- data/lib/best_in_place.rb +29 -9
- data/lib/best_in_place/controller_extensions.rb +10 -13
- data/lib/best_in_place/display_methods.rb +26 -21
- data/lib/best_in_place/engine.rb +2 -2
- data/lib/best_in_place/helper.rb +145 -87
- data/lib/best_in_place/railtie.rb +5 -2
- data/lib/best_in_place/test_helpers.rb +0 -1
- data/lib/best_in_place/utils.rb +20 -12
- data/lib/best_in_place/version.rb +1 -1
- data/spec/{helpers/best_in_place_spec.rb → helper_spec.rb} +134 -99
- data/spec/integration/double_init_spec.rb +3 -5
- data/spec/integration/js_spec.rb +193 -123
- data/spec/integration/live_spec.rb +3 -4
- data/spec/integration/text_area_spec.rb +4 -4
- data/spec/internal/app/assets/images/info.png +0 -0
- data/{test_app → spec/internal}/app/assets/images/no.png +0 -0
- data/spec/internal/app/assets/images/purrBottom.png +0 -0
- data/spec/internal/app/assets/images/purrClose.png +0 -0
- data/spec/internal/app/assets/images/purrTop.png +0 -0
- data/{test_app → spec/internal}/app/assets/images/red_pen.png +0 -0
- data/{test_app → spec/internal}/app/assets/images/ui-bg_diagonals-thick_18_b81900_40x40.png +0 -0
- data/{test_app → spec/internal}/app/assets/images/ui-bg_diagonals-thick_20_666666_40x40.png +0 -0
- data/{test_app → spec/internal}/app/assets/images/ui-bg_flat_10_000000_40x100.png +0 -0
- data/{test_app → spec/internal}/app/assets/images/ui-bg_glass_100_f6f6f6_1x400.png +0 -0
- data/{test_app → spec/internal}/app/assets/images/ui-bg_glass_100_fdf5ce_1x400.png +0 -0
- data/{test_app → spec/internal}/app/assets/images/ui-bg_glass_65_ffffff_1x400.png +0 -0
- data/{test_app → spec/internal}/app/assets/images/ui-bg_gloss-wave_35_f6a828_500x100.png +0 -0
- data/{test_app → spec/internal}/app/assets/images/ui-bg_highlight-soft_100_eeeeee_1x100.png +0 -0
- data/{test_app → spec/internal}/app/assets/images/ui-bg_highlight-soft_75_ffe45c_1x100.png +0 -0
- data/{test_app → spec/internal}/app/assets/images/ui-icons_222222_256x240.png +0 -0
- data/{test_app → spec/internal}/app/assets/images/ui-icons_228ef1_256x240.png +0 -0
- data/{test_app → spec/internal}/app/assets/images/ui-icons_ef8c08_256x240.png +0 -0
- data/{test_app → spec/internal}/app/assets/images/ui-icons_ffd27a_256x240.png +0 -0
- data/{test_app → spec/internal}/app/assets/images/ui-icons_ffffff_256x240.png +0 -0
- data/{test_app → spec/internal}/app/assets/images/yes.png +0 -0
- data/spec/internal/app/assets/javascripts/application.js +37 -0
- data/{test_app → spec/internal}/app/assets/stylesheets/.gitkeep +0 -0
- data/{test_app → spec/internal}/app/assets/stylesheets/jquery-ui-1.8.16.custom.css.erb +1 -2
- data/{test_app → spec/internal}/app/assets/stylesheets/scaffold.css +1 -1
- data/{test_app → spec/internal}/app/assets/stylesheets/style.css.erb +2 -4
- data/{test_app → spec/internal}/app/controllers/admin/users_controller.rb +8 -3
- data/{test_app → spec/internal}/app/controllers/application_controller.rb +0 -0
- data/{test_app → spec/internal}/app/controllers/cuca/cars_controller.rb +0 -0
- data/{test_app → spec/internal}/app/controllers/users_controller.rb +8 -40
- data/{test_app → spec/internal}/app/helpers/application_helper.rb +0 -0
- data/spec/internal/app/helpers/users_helper.rb +29 -0
- data/{test_app → spec/internal}/app/models/cuca/car.rb +0 -0
- data/{test_app → spec/internal}/app/models/user.rb +5 -1
- data/{test_app → spec/internal}/app/views/admin/users/show.html.erb +2 -2
- data/{test_app → spec/internal}/app/views/cuca/cars/show.html.erb +0 -0
- data/{test_app → spec/internal}/app/views/layouts/application.html.erb +1 -1
- data/{test_app → spec/internal}/app/views/users/_form.html.erb +2 -2
- data/{test_app → spec/internal}/app/views/users/double_init.html.erb +4 -10
- data/spec/internal/app/views/users/edit.html.erb +5 -0
- data/{test_app → spec/internal}/app/views/users/email_field.html.erb +0 -0
- data/{test_app → spec/internal}/app/views/users/index.html.erb +0 -0
- data/{test_app → spec/internal}/app/views/users/new.html.erb +0 -0
- data/{test_app → spec/internal}/app/views/users/show.html.erb +32 -24
- data/{test_app → spec/internal}/app/views/users/show_ajax.html.erb +0 -0
- data/spec/internal/config/database.yml +5 -0
- data/{test_app → spec/internal}/config/initializers/countries.rb +0 -0
- data/{test_app → spec/internal}/config/initializers/default_date_format.rb +0 -0
- data/spec/internal/config/initializers/development.rb +8 -0
- data/{test_app → spec/internal}/config/routes.rb +1 -2
- data/spec/internal/db/schema.rb +26 -0
- data/{test_app → spec/internal}/public/favicon.ico +0 -0
- data/spec/rails_helper.rb +21 -0
- data/spec/support/retry_on_timeout.rb +4 -7
- data/spec/utils_spec.rb +21 -0
- data/vendor/assets/javascripts/jquery.autosize.js +272 -0
- data/{lib → vendor}/assets/javascripts/jquery.purr.js +1 -1
- metadata +92 -175
- data/lib/best_in_place/check_version.rb +0 -8
- data/spec/spec_helper.rb +0 -23
- data/test_app/Gemfile +0 -16
- data/test_app/README +0 -256
- data/test_app/Rakefile +0 -7
- data/test_app/app/assets/javascripts/application.js +0 -35
- data/test_app/app/helpers/users_helper.rb +0 -29
- data/test_app/config.ru +0 -4
- data/test_app/config/application.rb +0 -51
- data/test_app/config/boot.rb +0 -13
- data/test_app/config/database.yml +0 -22
- data/test_app/config/environment.rb +0 -5
- data/test_app/config/environments/development.rb +0 -25
- data/test_app/config/environments/production.rb +0 -49
- data/test_app/config/environments/test.rb +0 -35
- data/test_app/config/initializers/backtrace_silencers.rb +0 -7
- data/test_app/config/initializers/inflections.rb +0 -10
- data/test_app/config/initializers/mime_types.rb +0 -5
- data/test_app/config/initializers/secret_token.rb +0 -7
- data/test_app/config/initializers/session_store.rb +0 -8
- data/test_app/config/locales/en.yml +0 -5
- data/test_app/db/migrate/20101206205922_create_users.rb +0 -18
- data/test_app/db/migrate/20101212170114_add_receive_email_to_user.rb +0 -9
- data/test_app/db/migrate/20110115204441_add_description_to_user.rb +0 -9
- data/test_app/db/migrate/20111210084202_add_favorite_color_to_users.rb +0 -5
- data/test_app/db/migrate/20111210084251_add_favorite_books_to_users.rb +0 -5
- data/test_app/db/migrate/20111217215935_add_birth_date_to_users.rb +0 -5
- data/test_app/db/migrate/20111224181356_add_money_to_user.rb +0 -5
- data/test_app/db/migrate/20120513003308_create_cars.rb +0 -11
- data/test_app/db/migrate/20120607172609_add_favorite_movie_to_users.rb +0 -5
- data/test_app/db/migrate/20120616170454_add_money_proc_to_users.rb +0 -6
- data/test_app/db/migrate/20120620165212_add_height_to_user.rb +0 -5
- data/test_app/db/migrate/20130213224102_add_favorite_locale_to_users.rb +0 -5
- data/test_app/db/schema.rb +0 -41
- data/test_app/db/seeds.rb +0 -19
- data/test_app/doc/README_FOR_APP +0 -2
- data/test_app/lib/tasks/.gitkeep +0 -0
- data/test_app/lib/tasks/cron.rake +0 -7
- data/test_app/public/404.html +0 -26
- data/test_app/public/422.html +0 -26
- data/test_app/public/500.html +0 -26
- data/test_app/public/robots.txt +0 -5
- data/test_app/script/rails +0 -6
- data/test_app/test/fixtures/users.yml +0 -17
- data/test_app/test/functional/users_controller_test.rb +0 -49
- data/test_app/test/performance/browsing_test.rb +0 -9
- data/test_app/test/test_helper.rb +0 -13
- data/test_app/test/unit/helpers/users_helper_test.rb +0 -4
- data/test_app/test/unit/user_test.rb +0 -8
- data/test_app/vendor/plugins/.gitkeep +0 -0
@@ -1,5 +1,4 @@
|
|
1
1
|
# encoding: utf-8
|
2
|
-
require "spec_helper"
|
3
2
|
|
4
3
|
describe "Monitor new fields", :js => true do
|
5
4
|
before do
|
@@ -22,19 +21,19 @@ describe "Monitor new fields", :js => true do
|
|
22
21
|
sleep(1) #give time to the ajax request to work
|
23
22
|
|
24
23
|
within("#email") do
|
25
|
-
page.
|
24
|
+
expect(page).to have_content("lucianapoli@gmail")
|
26
25
|
end
|
27
26
|
|
28
27
|
bip_text @user, :email, "new@email.com"
|
29
28
|
|
30
29
|
within("#email") do
|
31
|
-
page.
|
30
|
+
expect(page).to have_content("new@email.com")
|
32
31
|
end
|
33
32
|
|
34
33
|
bip_text @user, :email, "new_two@email.com"
|
35
34
|
|
36
35
|
within("#email") do
|
37
|
-
page.
|
36
|
+
expect(page).to have_content("new_two@email.com")
|
38
37
|
end
|
39
38
|
end
|
40
39
|
end
|
@@ -1,5 +1,5 @@
|
|
1
1
|
# encoding: utf-8
|
2
|
-
require
|
2
|
+
require 'rails_helper'
|
3
3
|
|
4
4
|
describe "JS behaviour", :js => true do
|
5
5
|
before do
|
@@ -18,14 +18,14 @@ describe "JS behaviour", :js => true do
|
|
18
18
|
@user.save!
|
19
19
|
visit user_path(@user)
|
20
20
|
within("#description") do
|
21
|
-
page.
|
21
|
+
expect(page).to have_content("User description")
|
22
22
|
end
|
23
23
|
|
24
24
|
bip_area @user, :description, "A new description"
|
25
25
|
|
26
26
|
visit user_path(@user)
|
27
27
|
within("#description") do
|
28
|
-
page.
|
28
|
+
expect(page).to have_content("A new description")
|
29
29
|
end
|
30
30
|
end
|
31
31
|
|
@@ -34,7 +34,7 @@ describe "JS behaviour", :js => true do
|
|
34
34
|
@user.save!
|
35
35
|
visit user_path(@user)
|
36
36
|
within("#dw_description") do
|
37
|
-
page.
|
37
|
+
expect(page).to have_content("I'm so awesome")
|
38
38
|
end
|
39
39
|
end
|
40
40
|
end
|
Binary file
|
File without changes
|
Binary file
|
Binary file
|
Binary file
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|
@@ -0,0 +1,37 @@
|
|
1
|
+
//= require jquery
|
2
|
+
//= require jquery-ui
|
3
|
+
//= require jquery.purr
|
4
|
+
//= require best_in_place
|
5
|
+
//= require best_in_place.jquery-ui
|
6
|
+
//= require best_in_place.purr
|
7
|
+
//= require_self
|
8
|
+
|
9
|
+
$(document).ready(function() {
|
10
|
+
/* Activating Best In Place */
|
11
|
+
jQuery(".best_in_place").best_in_place();
|
12
|
+
});
|
13
|
+
|
14
|
+
|
15
|
+
/* Inicialització en català per a l'extenció 'calendar' per jQuery. */
|
16
|
+
/* Writers: (joan.leon@gmail.com). */
|
17
|
+
jQuery(function($){
|
18
|
+
$.datepicker.regional['ca'] = {
|
19
|
+
closeText: 'Tancar',
|
20
|
+
prevText: '<Ant',
|
21
|
+
nextText: 'Seg>',
|
22
|
+
currentText: 'Avui',
|
23
|
+
monthNames: ['Gener','Febrer','Març','Abril','Maig','Juny',
|
24
|
+
'Juliol','Agost','Setembre','Octubre','Novembre','Desembre'],
|
25
|
+
monthNamesShort: ['Gen','Feb','Mar','Abr','Mai','Jun',
|
26
|
+
'Jul','Ago','Set','Oct','Nov','Des'],
|
27
|
+
dayNames: ['Diumenge','Dilluns','Dimarts','Dimecres','Dijous','Divendres','Dissabte'],
|
28
|
+
dayNamesShort: ['Dug','Dln','Dmt','Dmc','Djs','Dvn','Dsb'],
|
29
|
+
dayNamesMin: ['Dg','Dl','Dt','Dc','Dj','Dv','Ds'],
|
30
|
+
weekHeader: 'Sm',
|
31
|
+
dateFormat: 'dd-mm-yy',
|
32
|
+
firstDay: 1,
|
33
|
+
isRTL: false,
|
34
|
+
showMonthAfterYear: false,
|
35
|
+
yearSuffix: ''};
|
36
|
+
$.datepicker.setDefaults($.datepicker.regional['ca']);
|
37
|
+
});
|
File without changes
|
@@ -345,8 +345,7 @@
|
|
345
345
|
|
346
346
|
/* IE6 IFRAME FIX (taken from datepicker 1.5.3 */
|
347
347
|
.ui-datepicker-cover {
|
348
|
-
display:
|
349
|
-
display/**/: block; /*sorry for IE5*/
|
348
|
+
display: block; /*sorry for IE5*/
|
350
349
|
position: absolute; /*must have*/
|
351
350
|
z-index: -1; /*must have*/
|
352
351
|
filter: mask(); /*must have*/
|
@@ -36,8 +36,7 @@ textarea {
|
|
36
36
|
min-width: 40em;
|
37
37
|
}
|
38
38
|
.best_in_place {
|
39
|
-
padding: .
|
40
|
-
cursor: hand;
|
39
|
+
padding: 0.1em;
|
41
40
|
cursor: pointer;
|
42
41
|
-moz-border-radius: 5px;
|
43
42
|
-webkit-border-radius: 5px;
|
@@ -53,7 +52,6 @@ textarea {
|
|
53
52
|
}
|
54
53
|
.info_edit {
|
55
54
|
float: right;
|
56
|
-
cursor: hand;
|
57
55
|
cursor: pointer;
|
58
56
|
}
|
59
57
|
|
@@ -83,5 +81,5 @@ textarea {
|
|
83
81
|
width: 25px;
|
84
82
|
height: 25px;
|
85
83
|
text-indent: -9999px;
|
86
|
-
background: url("
|
84
|
+
background: url(<%= image_path("purrClose.png") %>) no-repeat;
|
87
85
|
}
|
@@ -5,10 +5,15 @@ class Admin::UsersController < ApplicationController
|
|
5
5
|
|
6
6
|
def update
|
7
7
|
@user = User.find(params[:id])
|
8
|
-
|
9
8
|
respond_to do |format|
|
10
|
-
@user.update_attributes(
|
11
|
-
format.json { respond_with_bip(@user) }
|
9
|
+
@user.update_attributes(user_params)
|
10
|
+
format.json { respond_with_bip(@user, param: :admin) }
|
12
11
|
end
|
13
12
|
end
|
13
|
+
|
14
|
+
private
|
15
|
+
|
16
|
+
def user_params
|
17
|
+
params.require(:admin).permit!
|
18
|
+
end
|
14
19
|
end
|
File without changes
|
File without changes
|
@@ -14,7 +14,7 @@ class UsersController < ApplicationController
|
|
14
14
|
# GET /users/1.xml
|
15
15
|
def show
|
16
16
|
@user = User.find(params[:id])
|
17
|
-
@countries = COUNTRIES
|
17
|
+
@countries = COUNTRIES
|
18
18
|
|
19
19
|
respond_to do |format|
|
20
20
|
format.html # show.html.erb
|
@@ -29,23 +29,12 @@ class UsersController < ApplicationController
|
|
29
29
|
|
30
30
|
def show_ajax
|
31
31
|
@user = User.find(params[:id])
|
32
|
-
@countries = COUNTRIES
|
32
|
+
@countries = COUNTRIES
|
33
33
|
end
|
34
34
|
|
35
35
|
def double_init
|
36
36
|
@user = User.find(params[:id])
|
37
|
-
@countries = COUNTRIES
|
38
|
-
end
|
39
|
-
|
40
|
-
# GET /users/new
|
41
|
-
# GET /users/new.xml
|
42
|
-
def new
|
43
|
-
@user = User.new
|
44
|
-
|
45
|
-
respond_to do |format|
|
46
|
-
format.html # new.html.erb
|
47
|
-
format.xml { render :xml => @user }
|
48
|
-
end
|
37
|
+
@countries = COUNTRIES
|
49
38
|
end
|
50
39
|
|
51
40
|
# GET /users/1/edit
|
@@ -53,29 +42,13 @@ class UsersController < ApplicationController
|
|
53
42
|
@user = User.find(params[:id])
|
54
43
|
end
|
55
44
|
|
56
|
-
# POST /users
|
57
|
-
# POST /users.xml
|
58
|
-
def create
|
59
|
-
@user = User.new(params[:user])
|
60
|
-
|
61
|
-
respond_to do |format|
|
62
|
-
if @user.save
|
63
|
-
format.html { redirect_to(@user, :notice => 'User was successfully created.') }
|
64
|
-
format.xml { render :xml => @user, :status => :created, :location => @user }
|
65
|
-
else
|
66
|
-
format.html { render :action => "new" }
|
67
|
-
format.xml { render :xml => @user.errors, :status => :unprocessable_entity }
|
68
|
-
end
|
69
|
-
end
|
70
|
-
end
|
71
|
-
|
72
45
|
# PUT /users/1
|
73
46
|
# PUT /users/1.xml
|
74
47
|
def update
|
75
48
|
@user = User.find(params[:id])
|
76
49
|
|
77
50
|
respond_to do |format|
|
78
|
-
if @user.update_attributes(
|
51
|
+
if @user.update_attributes(user_params)
|
79
52
|
format.html { redirect_to(@user, :notice => 'User was successfully updated.') }
|
80
53
|
format.json { respond_with_bip(@user) }
|
81
54
|
else
|
@@ -85,15 +58,10 @@ class UsersController < ApplicationController
|
|
85
58
|
end
|
86
59
|
end
|
87
60
|
|
88
|
-
# DELETE /users/1
|
89
|
-
# DELETE /users/1.xml
|
90
|
-
def destroy
|
91
|
-
@user = User.find(params[:id])
|
92
|
-
@user.destroy
|
93
61
|
|
94
|
-
|
95
|
-
|
96
|
-
|
97
|
-
|
62
|
+
private
|
63
|
+
|
64
|
+
def user_params
|
65
|
+
params.require(:user).permit!
|
98
66
|
end
|
99
67
|
end
|
File without changes
|
@@ -0,0 +1,29 @@
|
|
1
|
+
#encoding: utf-8
|
2
|
+
module UsersHelper
|
3
|
+
def height_collection
|
4
|
+
{
|
5
|
+
'h51' => %{5' 1"},
|
6
|
+
'h52' => %{5' 2"},
|
7
|
+
'h53' => %{5' 3"},
|
8
|
+
'h54' => %{5' 4"},
|
9
|
+
'h55' => %{5' 5"},
|
10
|
+
'5\' 6"' => %{5' 6"}, # Using space and quotes in value is just asking for troubles
|
11
|
+
'5\' 7"' => %{5' 7"},
|
12
|
+
'h58' => %{5' 8"},
|
13
|
+
'h59' => %{5' 9"},
|
14
|
+
'5\' 10"' => %{5' 10"},
|
15
|
+
'h511' => %{5' 11"},
|
16
|
+
'h60' => %{6' 0"},
|
17
|
+
'h61' => %{6' 1"},
|
18
|
+
'h62' => %{6' 2"},
|
19
|
+
'h63' => %{6' 3"},
|
20
|
+
'h64' => %{6' 4"},
|
21
|
+
'h65' => %{6' 5"},
|
22
|
+
'h66' => %{6' 6"}
|
23
|
+
}
|
24
|
+
end
|
25
|
+
|
26
|
+
def bb(value)
|
27
|
+
"#{value} €"
|
28
|
+
end
|
29
|
+
end
|
File without changes
|
@@ -10,7 +10,7 @@ class User < ActiveRecord::Base
|
|
10
10
|
:presence => {:message => "can't be blank"}
|
11
11
|
validates :email,
|
12
12
|
:presence => {:message => "can't be blank"},
|
13
|
-
:format => {:with =>
|
13
|
+
:format => {:with => /\A([^@\s]+)@((?:[-a-z0-9]+\.)+[a-z]{2,})\z/i, :message => "has wrong email format"}
|
14
14
|
validates :zip, :numericality => true, :length => { :minimum => 5 }
|
15
15
|
validates_numericality_of :money, :allow_blank => true
|
16
16
|
validates_numericality_of :money_proc, :allow_blank => true
|
@@ -24,4 +24,8 @@ class User < ActiveRecord::Base
|
|
24
24
|
def markdown_desc
|
25
25
|
RDiscount.new(description).to_html.html_safe
|
26
26
|
end
|
27
|
+
|
28
|
+
def zip_format
|
29
|
+
nil
|
30
|
+
end
|
27
31
|
end
|
@@ -6,13 +6,13 @@
|
|
6
6
|
<table>
|
7
7
|
<tr>
|
8
8
|
<td id="name">
|
9
|
-
<%= best_in_place
|
9
|
+
<%= best_in_place @user, :name, url: {action: :update} , param: :admin %>
|
10
10
|
</td>
|
11
11
|
</tr>
|
12
12
|
<tr>
|
13
13
|
<td>Last Name</td>
|
14
14
|
<td id="last_name">
|
15
|
-
<%= best_in_place [:admin, @user], :last_name, :
|
15
|
+
<%= best_in_place [:admin, @user], :last_name, place_holder: 'Nothing to show' , param: :admin %>
|
16
16
|
</td>
|
17
17
|
</tr>
|
18
18
|
</table>
|
File without changes
|
@@ -1,7 +1,7 @@
|
|
1
1
|
<!DOCTYPE html>
|
2
2
|
<html>
|
3
3
|
<head>
|
4
|
-
<title>Best In Place TEST APP
|
4
|
+
<title>Best In Place TEST APP <%= Rails::VERSION::STRING %></title>
|
5
5
|
<%= stylesheet_link_tag "scaffold", "style", "jquery-ui-1.8.16.custom" %>
|
6
6
|
<%= javascript_include_tag "application" %>
|
7
7
|
<%= csrf_meta_tag %>
|
@@ -37,14 +37,14 @@
|
|
37
37
|
</div>
|
38
38
|
<div class="field">
|
39
39
|
<%= f.label :country %><br />
|
40
|
-
<%=
|
41
|
-
f.select :country, COUNTRIES.map {|c|
|
40
|
+
<%= f.select :country, COUNTRIES.map {|c|
|
42
41
|
v0 = c[0]
|
43
42
|
c[0] = c[1]
|
44
43
|
c[1] = v0
|
45
44
|
c
|
46
45
|
}
|
47
46
|
%>
|
47
|
+
</div>
|
48
48
|
<div class="actions">
|
49
49
|
<%= f.submit %>
|
50
50
|
</div>
|
@@ -7,13 +7,7 @@
|
|
7
7
|
<tr>
|
8
8
|
<td>Name <a id="editme" href="#">(edit me)</a></td>
|
9
9
|
<td id="name">
|
10
|
-
<%= best_in_place @user, :name, :
|
11
|
-
</td>
|
12
|
-
</tr>
|
13
|
-
<tr>
|
14
|
-
<td>Last Name</td>
|
15
|
-
<td id="last_name">
|
16
|
-
<%= best_in_place @user, :last_name, :nil => "Nothing to show", :path => test_respond_with_user_path(@user) %>
|
10
|
+
<%= best_in_place @user, :name, as: :input, :activator => "#editme" %>
|
17
11
|
</td>
|
18
12
|
</tr>
|
19
13
|
<tr>
|
@@ -37,19 +31,19 @@
|
|
37
31
|
<tr>
|
38
32
|
<td>Country</td>
|
39
33
|
<td id="country">
|
40
|
-
<%= best_in_place @user, :country, :
|
34
|
+
<%= best_in_place @user, :country, as: :select, :collection => @countries %>
|
41
35
|
</td>
|
42
36
|
</tr>
|
43
37
|
<tr>
|
44
38
|
<td>Receive newsletter?</td>
|
45
39
|
<td id="receive_email">
|
46
|
-
<%= best_in_place @user, :receive_email, :
|
40
|
+
<%= best_in_place @user, :receive_email, as: :checkbox, collection: {'false'=>"No thanks", 'true'=>"Yes of course"} %>
|
47
41
|
</td>
|
48
42
|
</tr>
|
49
43
|
<tr>
|
50
44
|
<td>User description</td>
|
51
45
|
<td id="description">
|
52
|
-
<%= best_in_place @user, :description, :
|
46
|
+
<%= best_in_place @user, :description, as: :textarea, :raw => true %>
|
53
47
|
</td>
|
54
48
|
</tr>
|
55
49
|
<tr>
|