feedback_gem 0.2.7 → 0.2.8

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 CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA256:
3
- metadata.gz: 84dea5da0edc3893e80beeadf42e6f619488f6e40e48e25f2b9fd82b3426e901
4
- data.tar.gz: 97152d34db6325604568e43546d1a372ce88cba6620b37138b4f03507cf78098
3
+ metadata.gz: 73b40e970b6d112c45cc23beab8c768bd0ac2b6d68a00f9bb1c39588433370a6
4
+ data.tar.gz: 7db9368a384d460487cac1f8998a0d18191258772c8734ea6afae4e93314ec9e
5
5
  SHA512:
6
- metadata.gz: 6ced1f81596ee701830d6c88fbf6af9412aac6fcb2e171c593b59aefd803d90db677959787cacc1fcb1de3fd9b556811c70f75e8416fcc465d95e15b66e73003
7
- data.tar.gz: 653d8ea45b93db5aa54eb5f95aca1eb05728103839a661b0018262ccb11a06dbd6ed2c431579972d54d8baf8029bbd97abf36b04690885a766e6d30a24c49916
6
+ metadata.gz: 128c34ef93740261b88dc2066613404d6fe91db8743f5bc1e3409bf790bdd7457681b55fb1439cdab26eceefb603a01d1560262505fce15bbb29fd247a7200fd
7
+ data.tar.gz: d07885f67e19a4b11d6345fd3d0b586f35b98a76c452124278b4ea7f5d0d291e43b570be969250ff8c364b17e5a613223071394b1fad36497e59dcf089aed250
@@ -1,2 +1,16 @@
1
1
  // Place all the behaviors and hooks related to the matching controller here.
2
2
  // All this logic will automatically be available in application.js.
3
+
4
+
5
+ $(document).ready(function () {
6
+ $("#new_feedback").validate({
7
+ debug: true,
8
+ rules: {
9
+ "feedback[name]": {required: true},
10
+ "feedback[email]": {required: true, email: true},
11
+ "feedback[subject]": {required: true},
12
+ "feedback[description]": {required: true}
13
+ }
14
+ });
15
+ });
16
+
@@ -51,9 +51,15 @@ html, body {
51
51
  height: 100%;
52
52
  }
53
53
  .footer{
54
- background-color:#BFC3C6;
55
- height: 62px;
56
- margin:20px auto;
57
- padding:20px;
58
- text-align:center;
54
+ background-color:#BFC3C6;
55
+ height: 62px;
56
+ margin:20px auto;
57
+ padding:20px;
58
+ text-align:center;
59
59
  }
60
+ .navtext{
61
+ text-align:left;
62
+ }
63
+ .nav-item a:hover{
64
+ cursor:disabled;
65
+ }
@@ -4,6 +4,7 @@ module FeedbackGem
4
4
  class FeedbacksController < ApplicationController
5
5
  def index
6
6
  @feedbacks = Feedback.order('created_at DESC')
7
+ @feedbacks = @feedbacks.search(params[:search]) if params[:search].present?
7
8
  end
8
9
  def new
9
10
  @feedback = Feedback.new
@@ -15,7 +16,7 @@ module FeedbackGem
15
16
  @feedback = Feedback.new(feedback_params)
16
17
  if@feedback.save
17
18
  flash[:success] = "Feedback successfully created"
18
- redirect_to @feedback
19
+ redirect_to feedbacks_path
19
20
  else
20
21
  flash[:error] = "Feeback is not created"
21
22
  render 'new'
@@ -1,5 +1,8 @@
1
1
  module FeedbackGem
2
2
  class Feedback < ApplicationRecord
3
3
  validates :name,:email,:subject,:description,presence: true
4
+ def self.search(searchname)
5
+ where('name LIKE ?',searchname)
6
+ end
4
7
  end
5
8
  end
@@ -1,8 +1,16 @@
1
1
  <div class="container-fluid header">
2
- <nav class="navbar navbar-light header">
3
- <a class="navbar-brand" href="#">
4
- <img src="/docs/4.3/assets/brand/bootstrap-solid.svg" width="30" height="30" class="d-inline-block align-top" alt="">
5
- Feedbacks Engine
6
- </a>
2
+ <nav class="navbar navbar-expand-lg navbar-light header">
3
+ <%=link_to feedbacks_path do %>
4
+ <span class="fa fa-home"></span>
5
+ <%end%>
6
+ <div class="collapse navbar-collapse" id="navbarNavDropdown">
7
+ <ul class="navbar-nav">
8
+ <li class="nav-item">
9
+ <a class="nav-link" href="#">Feedbacks</a>
10
+ </li>
11
+ </ul>
12
+ </div>
7
13
  </nav>
8
- </div>
14
+ </div>
15
+
16
+
@@ -11,7 +11,7 @@
11
11
  <%=f.label :name %>
12
12
  </div>
13
13
  <div class='offset-1 col col-md-9'>
14
- <%=f.text_field :name,:class=>"input" %>
14
+ <%=f.text_field :name,:class=>"input",required: true %>
15
15
  </div>
16
16
  </div>
17
17
  <div class='row formfields'>
@@ -19,7 +19,7 @@
19
19
  <%=f.label :email %>
20
20
  </div>
21
21
  <div class='offset-1 col col-md-9'>
22
- <%=f.text_field :email,:class=>"input" %>
22
+ <%=f.text_field :email,:class=>"input",required: true,type: "email" %>
23
23
  </div>
24
24
  </div>
25
25
  <div class='row formfields'>
@@ -27,7 +27,7 @@
27
27
  <%=f.label :subject %>
28
28
  </div>
29
29
  <div class='offset-1 col col-md-9'>
30
- <%=f.text_field :subject,:class=>"input" %>
30
+ <%=f.text_field :subject,:class=>"input",required: true %>
31
31
  </div>
32
32
  </div>
33
33
  <div class='row formfields'>
@@ -35,7 +35,7 @@
35
35
  <%=f.label :description %>
36
36
  </div>
37
37
  <div class='offset-1 col col-md-9'>
38
- <%=f.text_field :description,:class=>"input" %>
38
+ <%=f.text_field :description,:class=>"input",required: true %>
39
39
  </div>
40
40
  </div>
41
41
  <div class="row formfields">
@@ -4,9 +4,13 @@
4
4
  <%= value %>
5
5
  </div>
6
6
  <% end %>
7
- <div class="newpost">
7
+ <nav class="navbar navbar-light bg-light">
8
8
  <%=link_to 'create new feedback', new_feedback_path,:class=>'btn btn-warning' %>
9
- </div>
9
+ <%= form_tag(feedbacks_path, :method => "get", id: "feedback-form",:class=>"form-inline") do %>
10
+ <%= text_field_tag :search, params[:search], placeholder: "Search feedbacks",:class=>"form-control mr-sm-2" %>
11
+ <%= submit_tag "Search",:class=>"btn btn-outline-success my-2 my-sm-0" %>
12
+ <% end %>
13
+ </nav>
10
14
  <div class="feedbacklist">
11
15
  <table class="table table-bordered table-hover">
12
16
  <thead class="thead-light">
@@ -11,7 +11,7 @@
11
11
  <%=f.label :name %>
12
12
  </div>
13
13
  <div class='offset-1 col col-md-9'>
14
- <%=f.text_field :name,:class=>"input" %>
14
+ <%=f.text_field :name,:class=>"input",required: true %>
15
15
  </div>
16
16
  </div>
17
17
  <div class='row formfields'>
@@ -19,7 +19,7 @@
19
19
  <%=f.label :email %>
20
20
  </div>
21
21
  <div class='offset-1 col col-md-9'>
22
- <%=f.text_field :email,:class=>"input" %>
22
+ <%=f.text_field :email,:class=>"input",required: true,type: "email" %>
23
23
  </div>
24
24
  </div>
25
25
  <div class='row formfields'>
@@ -27,7 +27,7 @@
27
27
  <%=f.label :subject %>
28
28
  </div>
29
29
  <div class='offset-1 col col-md-9'>
30
- <%=f.text_field :subject,:class=>"input" %>
30
+ <%=f.text_field :subject,:class=>"input",required: true %>
31
31
  </div>
32
32
  </div>
33
33
  <div class='row formfields'>
@@ -35,7 +35,7 @@
35
35
  <%=f.label :description %>
36
36
  </div>
37
37
  <div class='offset-1 col col-md-9'>
38
- <%=f.text_field :description,:class=>"input" %>
38
+ <%=f.text_field :description,:class=>"input",required: true %>
39
39
  </div>
40
40
  </div>
41
41
  <div class="row formfields">
@@ -12,6 +12,8 @@
12
12
  <link rel="stylesheet" href="https://maxcdn.bootstrapcdn.com/bootstrap/4.0.0/css/bootstrap.min.css" integrity="sha384-Gn5384xqQ1aoWXA+058RXPxPg6fy4IWvTNh0E263XmFcJlSAwiGgFAW/dAiS6JXm" crossorigin="anonymous">
13
13
  <script src="https://maxcdn.bootstrapcdn.com/bootstrap/4.0.0/js/bootstrap.min.js" integrity="sha384-JZR6Spejh4U02d8jOt6vLEHfe/JQGiRRSQQxSfFWpi1MquVdAyjUar5+76PVCmYl" crossorigin="anonymous"></script>
14
14
  <link href="https://stackpath.bootstrapcdn.com/font-awesome/4.7.0/css/font-awesome.min.css" rel="stylesheet" integrity="sha384-wvfXpqpZZVQGK6TAh5PVlGOfQNHSoD2xbE+QkPxCAFlNEevoEH3Sl0sibVcOQVnN" crossorigin="anonymous">
15
+ <%= javascript_include_tag "https://cdnjs.cloudflare.com/ajax/libs/jquery-validate/1.15.1/jquery.validate.min.js" %>
16
+ <%= javascript_include_tag "https://cdnjs.cloudflare.com/ajax/libs/jquery-validate/1.15.1/additional-methods.min.js" %>
15
17
  </head>
16
18
  <body>
17
19
  <%= render "feedback_gem/feedbacks/header" %>
@@ -1,3 +1,3 @@
1
1
  module FeedbackGem
2
- VERSION = '0.2.7'
2
+ VERSION = '0.2.8'
3
3
  end
metadata CHANGED
@@ -1,7 +1,7 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: feedback_gem
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.2.7
4
+ version: 0.2.8
5
5
  platform: ruby
6
6
  authors:
7
7
  - geethatulasi-nyros