wrgem 0.0.39 → 0.0.40

Sign up to get free protection for your applications and to get access to all the features.
checksums.yaml CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA1:
3
- metadata.gz: dd514e46fe6eb5cc23e5b99390284876c7d54169
4
- data.tar.gz: 125aaaae09d205c80ce5e977fd55da44bb65709e
3
+ metadata.gz: fb2c4cf0141fb62d27423cea3ec7443d7ceeb3ab
4
+ data.tar.gz: dfe63fd62030e69e0636f4788e42d19cbd8fae5b
5
5
  SHA512:
6
- metadata.gz: eb48ce070583adff95d3a3c7ca0b7d868960b238207e5406316d83ca4718dcfe3dbd4a87b979c63b17f7b8e6d89b585fd786ae6d663a60850cb38be5608609bd
7
- data.tar.gz: 0b7612fc4eded8f96f24d9067fb1507786db292d159c30be37d3d1469daefc87e1545aa4db47e11d2a6f87e79ded8a840d34636a3f9280a922903cdbbe6c9e0e
6
+ metadata.gz: 9c0dfebec4ff501ef977d2c0b9bd2a3978f1dd9e120df51017fc67390716775487e5c878ea6c5b9c73a0bcbfafc263371a61b3bd852a73ec4f3ec50244d3cb55
7
+ data.tar.gz: ce36a91229ee759b68f56f6207b44380fc782cd9038da8f7b4140067d63e0d9cb806e346c7190ed057e38ead1a1a3ed44c97f941322c02939a8fc438a1dad86b
@@ -163,6 +163,8 @@ label.checkbox
163
163
  perspective: 1000px
164
164
  color: #b0324a
165
165
  text-align: center
166
+ img
167
+ max-width: 71px
166
168
 
167
169
  ul
168
170
  &.navigation
@@ -24,19 +24,21 @@ class <%= controller_class_name %>Controller < ApplicationController
24
24
  def create
25
25
  @<%= singular_table_name %> = <%= orm_class.build(class_name, "#{singular_table_name}_params") %>
26
26
 
27
- if @<%= orm_instance.save %>
28
- redirect_to <%= plural_table_name %>_path, notice: 'Criado com sucesso.'
29
- else
30
- render action: 'new'
27
+ respond_to do |format|
28
+ if @<%= orm_instance.save %>
29
+ format.js
30
+ end
31
31
  end
32
+ flash[:notice] = 'Criado com sucesso.'
32
33
  end
33
34
 
34
35
  def update
35
- if @<%= orm_instance.update("#{singular_table_name}_params") %>
36
- redirect_to <%= plural_table_name %>_path, notice: 'Alterado com sucesso.'
37
- else
38
- render action: 'edit'
36
+ respond_to do |format|
37
+ if @<%= orm_instance.update("#{singular_table_name}_params") %>
38
+ format.js
39
+ end
39
40
  end
41
+ flash[:notice] = 'Editado com sucesso.'
40
42
  end
41
43
 
42
44
  def destroy
@@ -1,7 +1,8 @@
1
- = simple_form_for(@<%= singular_table_name %>) do |f|
1
+ = simple_form_for(@<%= singular_table_name %>, :remote => true) do |f|
2
2
  = f.error_notification
3
3
 
4
4
  <%- attributes.each do |attribute| -%>
5
+
5
6
  .form-group
6
7
  = f.label "<%= attribute.name %>", class: "col-sm-3 control-label"
7
8
  .col-sm-9
@@ -0,0 +1 @@
1
+ window.location.href = "<%=plural_table_name_url %>";
@@ -0,0 +1 @@
1
+ window.location.href = "<%=plural_table_name_url %>";
data/lib/wrgem/version.rb CHANGED
@@ -1,3 +1,3 @@
1
1
  module Wrgem
2
- VERSION = "0.0.39"
2
+ VERSION = "0.0.40"
3
3
  end
metadata CHANGED
@@ -1,7 +1,7 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: wrgem
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.0.39
4
+ version: 0.0.40
5
5
  platform: ruby
6
6
  authors:
7
7
  - davidleandro
@@ -342,10 +342,12 @@ files:
342
342
  - lib/generators/wradmin/template/lib/assets/stylesheets/style-responsive.css
343
343
  - lib/generators/wradmin/template/lib/templates/rails/scaffold_controller/controller.rb
344
344
  - lib/generators/wradmin/template/lib/templates/slim/scaffold/_form.html.slim
345
+ - lib/generators/wradmin/template/lib/templates/slim/scaffold/create.js.erb
345
346
  - lib/generators/wradmin/template/lib/templates/slim/scaffold/edit.html.slim
346
347
  - lib/generators/wradmin/template/lib/templates/slim/scaffold/index.html.slim
347
348
  - lib/generators/wradmin/template/lib/templates/slim/scaffold/new.html.slim
348
349
  - lib/generators/wradmin/template/lib/templates/slim/scaffold/show.html.slim
350
+ - lib/generators/wradmin/template/lib/templates/slim/scaffold/update.js.erb
349
351
  - lib/generators/wradmin/template/locales/pt-br.yml
350
352
  - lib/generators/wradmin/template/locales/simple_form.pt-br.yml
351
353
  - lib/generators/wradmin/template/migrate/20140711182158_devise_create_users.rb