.row.rewards
  .col-md-3= render partial: 'main/profile'
  .col-md-9
    .row
      .col-md-6.col-md-offset-3
        form action=(rewards_path)
          .input-group
            input.form-control.input-lg placeholder=("Search for...") type="text" name="query" autocomplete="off" value=(@query)
            span.input-group-btn
              button.btn.btn-default.btn-lg type="submit"  Search
          input type="hidden" value=(@page) name="page"
        br
    - if @rewards.count > 0
      .row
        - @rewards.each do |r|
          .col-md-3
            .panel.panel-default.reward
              .branding style=("background: #{r.background_color}; color: #{r.font_color};") title=(r.description)
                =r.name
              .info
                .points="#{r.points}pts"
                - if r.points <= current_user.points
                  = link_to "Redeem", redeem_reward_path(reward_id: r.id), method: :post, data: {confirm: "Are you sure, click ok to confirm?"} , class: "btn btn-default btn-sm"
                - else
                  a.btn.btn-default.btn-sm disabled="disabled" title="You don't have enough points to redeem this coupon" Redeem
      .pull-right
        = paginate @rewards, :theme => 'twitter-bootstrap-3'
    - else
      .row
        .col-md-6.col-md-offset-3
          br
          br
          br
          h3 Oopss... no result found

.row.rewards
  .col-md-3= render partial: 'main/profile'
  .col-md-9
    .row
      .col-md-6.col-md-offset-3
        form action=(rewards_path)
          .input-group
            input.form-control.input-lg placeholder=("Search for...") type="text" name="query" autocomplete="off" value=(@query)
            span.input-group-btn
              button.btn.btn-default.btn-lg type="submit"  Search
        br
    - if @rewards.count > 0
      .row
        - @rewards.each do |r|
          .col-md-3
            .panel.panel-default.reward
              .branding style=("background: #{r.background_color}; color: #{r.font_color};") title=(r.description)
                =r.name
              .info
                .points="#{r.points}pts"
                - if r.points <= current_user.points
                  = link_to "Redeem", redeem_reward_path(reward_id: r.id), method: :post, data: {confirm: "Are you sure, click ok to confirm?"} , class: "btn btn-default btn-sm"
                - else
                  a.btn.btn-default.btn-sm disabled="disabled" title="You don't have enough points to redeem this coupon" Redeem
      .pull-right
        = paginate @rewards, :theme => 'twitter-bootstrap-3'
    - else
      .row
        .col-md-6.col-md-offset-3
          br
          br
          br
          h3 Oopss... no result found

Fix search issue with pagination
Fix search issue with pagination

vishalvijay/reward_system,vishalvijay/reward_system