nyros_form2 0.1.2 → 0.1.3

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
  SHA256:
3
- metadata.gz: 119c76f8e5f23ff50c387f1ce8b124287597eb9ebc814ab6b862981330b506e1
4
- data.tar.gz: 7278a7ce8d1b6eecd0d894747f1ca841e4d987ae98f5ea7a1de9fe41fdc8354d
3
+ metadata.gz: c5e5f33967f2c30aaf8cb0de1c1c9320164162d8d8dc0c617a9594fe1bf57541
4
+ data.tar.gz: 6aca48e5a822542558b49e20aeee8b12c082abdcb768c9a982b52455dc156137
5
5
  SHA512:
6
- metadata.gz: fad28acaaecfa5bc837fe90301f78f57bca10be6d0eaf3a4db8eb687f5b6e96b644747916a331f6b4443edc68ab7af5b7229c7e2828ad3479748d21fee0857b9
7
- data.tar.gz: a14cde61b424bc4760d8f17bb37976779a091ae9ee4a14393018cef266d8dde387db383c3a43fafe40e68bbbac2162e16f0c100e3e34434bb374a9b1360ae3fa
6
+ metadata.gz: 4ef261960733eb4834dd05b47ed68ad0227516c46fc08cb30aacd9cea328f806b9867699b8f34d5c54b3cd134a9f3de4d0272ab05208211d69b9f8a1636321c3
7
+ data.tar.gz: a3511cb274764ed6fa1503323b224b133b245fc50ab818ab6922cc0b4c8d567772614379af84080d6a65d2911a71ac62fb6741d93653091c1e1e8aa06a913ee2
@@ -11,17 +11,19 @@ module NyrosForm2
11
11
  end
12
12
 
13
13
  def create
14
- @user = User.new(user_params)
15
- if @user.save
16
- render users_path
17
- else
18
- render json: @user_requirement.errors, status: :unprocessable_entity
19
- end
14
+ @user = User.new(user_params)
15
+ if @user.save
16
+
17
+ redirect_to users_path
18
+
19
+ else
20
+ render user_new_path
21
+ end
20
22
  end
21
23
 
22
24
 
23
25
  def show
24
- @user = User.find(params[:id])
26
+ @user = User.find(params[:id])
25
27
  end
26
28
 
27
29
  def edit
@@ -1,4 +1,32 @@
1
- <h1>Users#index</h1>
2
- <p>Find me in app/views/nyros_form2/users/index.html.erb</p>
1
+ <br><br>
2
+ <div class="container">
3
+ <div>
4
+ <h2>Users</h2>
5
+ <%= link_to "New_user", new_user_path %>
6
+ </div>
7
+ <table class="table">
8
+ <thead>
9
+ <tr>
10
+ <th>Id</th>
11
+ <th>name</th>
12
+ <th>email</th>
13
+ <th>mobile</th>
14
+ </tr>
15
+ </thead>
16
+ <tbody>
17
+ <% @users.each do |u| %>
18
+ <tr>
19
+ <td><%= u.id %> </td>
20
+ <td><%= u.name %></td>
21
+ <td><%= u.mobile %></td>
22
+ <td><%= u.email %></td>
23
+ </tr>
24
+ <% end %>
25
+ </tbody>
26
+ </table>
27
+
28
+
29
+
30
+ </div>
31
+
3
32
 
4
- <%= link_to "New", users_new_path %>
@@ -3,7 +3,7 @@
3
3
  <div class="form-horizontal no-border form u-dimension-2"
4
4
  style ="margin-top: 20px; width: 450px;"align="center" >
5
5
 
6
- <%= form_for(users_new_path) do |f| %>
6
+ <%= form_for @user, url: {action: :create} do |f| %>
7
7
  <h2 align="center">Sign in </h2>
8
8
  <% flash.each do |name, msg| %>
9
9
  <%= content_tag :div, msg, :id => "flash_#{name}" if msg.is_a?(String) %>
data/config/routes.rb CHANGED
@@ -1,10 +1,5 @@
1
1
  NyrosForm2::Engine.routes.draw do
2
- get 'users/index'
3
- get 'users/new'
4
- get 'users/show'
5
- get 'users/edit'
6
- get 'users/update'
7
- get 'users/delete'
2
+ resources :users
8
3
  # root :to => "failures#index"
9
4
  root :to => "users#new"
10
5
  end
@@ -1,3 +1,3 @@
1
1
  module NyrosForm2
2
- VERSION = '0.1.2'
2
+ VERSION = '0.1.3'
3
3
  end
metadata CHANGED
@@ -1,7 +1,7 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: nyros_form2
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.1.2
4
+ version: 0.1.3
5
5
  platform: ruby
6
6
  authors:
7
7
  - raju rekadi
@@ -74,7 +74,6 @@ files:
74
74
  - app/views/nyros_form2/users/new.html.erb
75
75
  - app/views/nyros_form2/users/show.html.erb
76
76
  - app/views/nyros_form2/users/update.html.erb
77
- - config/initializers/exception_handler.rb
78
77
  - config/routes.rb
79
78
  - db/migrate/20191014060751_create_nyros_form2_failures.rb
80
79
  - db/migrate/20191014071953_create_nyros_form2_users.rb
@@ -1,7 +0,0 @@
1
-
2
- ActiveSupport::Notifications.subscribe "process_action.action_controller" do |name, start, finish, id, payload|
3
- if payload[:exception]
4
- name, message = *payload[:exception]
5
- NyrosForm2::Failure.create!(:message => message)
6
- end
7
- end