Skip to content

  • Projects
  • Groups
  • Snippets
  • Help
  • This project
    • Loading...
  • Sign in / Register
V
venshop
  • Overview
    • Overview
    • Details
    • Activity
    • Cycle Analytics
  • Repository
    • Repository
    • Files
    • Commits
    • Branches
    • Tags
    • Contributors
    • Graph
    • Compare
    • Charts
  • Issues 0
    • Issues 0
    • List
    • Board
    • Labels
    • Milestones
  • Merge Requests 0
    • Merge Requests 0
  • CI / CD
    • CI / CD
    • Pipelines
    • Jobs
    • Schedules
    • Charts
  • Wiki
    • Wiki
  • Members
  • Collapse sidebar
  • Activity
  • Graph
  • Charts
  • Create a new issue
  • Jobs
  • Commits
  • Issue Boards
  • Tan Phat Nguyen
  • venshop
  • Merge Requests
  • !3

Merged
Opened Nov 19, 2014 by Tan Phat Nguyen@phatnt 
  • Report abuse
Report abuse

Feature/search function

Add feature search with solr index

×

Check out, review, and merge locally

Step 1. Fetch and check out the branch for this merge request

git fetch origin
git checkout -b feature/search_function origin/feature/search_function

Step 2. Review the changes locally

Step 3. Merge the branch and fix any conflicts that come up

git checkout master
git merge --no-ff feature/search_function

Step 4. Push the result of the merge to GitLab

git push origin master

Note that pushing to GitLab requires write access to this repository.

Tip: You can also checkout merge requests locally by following these guidelines.

  • Discussion 4
  • Commits 1
  • Changes
{{ resolvedDiscussionCount }}/{{ discussionCount }} {{ resolvedCountText }} resolved
  • Nguyen Ngoc Lan
    @lannn started a discussion on commit f8adf8bb Nov 19, 2014
    app/controllers/products_controller.rb
    1 1 class ProductsController < ApplicationController
    2 PAGINATE_PER = 10
    • Nguyen Ngoc Lan @lannn commented Nov 19, 2014
      Master

      @phatnt move this constant to config or model

      @phatnt move this constant to config or model
    Please register or sign in to reply
  • Nguyen Ngoc Lan
    @lannn started a discussion on commit f8adf8bb Nov 19, 2014
    app/controllers/products_controller.rb
    1 1 class ProductsController < ApplicationController
    2 PAGINATE_PER = 10
    2 3  
    3 4 def show
    4 5 @product = Product.find(params[:id])
    5 6 end
    7
    8 def index
    9 solr = RSolr.connect url: Rails.configuration.solr_host.to_s
    • Nguyen Ngoc Lan @lannn commented Nov 19, 2014
      Master

      @phatnt move this logic out of controller. Good place is service object with class Solr. This makes controller cleaner

      @phatnt move this logic out of controller. Good place is service object with class Solr. This makes controller cleaner
    Please register or sign in to reply
  • Nguyen Ngoc Lan
    @lannn started a discussion on commit f8adf8bb Nov 19, 2014
    app/views/application/_header.html.erb
    24 24 <% end %>
    25 25 <li style='width: 36px'><%= link_to '', cart_path(current_cart), class: 'nav-icon' %></li>
    26 26 </ul>
    27 <form class='navbar-form navbar-right'>
    28 <input type='text' class='form-control' placeholder='Search...'>
    29 </form>
    27 <%= form_tag products_path, method: 'get', class: 'navbar-form navbar-right' do %>
    • Nguyen Ngoc Lan @lannn commented Nov 19, 2014
      Master

      @phatnt You should extract search form to partial

      @phatnt You should extract search form to partial
    Please register or sign in to reply
  • Nguyen Ngoc Lan
    @lannn started a discussion on commit f8adf8bb Nov 19, 2014
    app/controllers/products_controller.rb
    1 1 class ProductsController < ApplicationController
    2 PAGINATE_PER = 10
    2 3  
    3 4 def show
    4 5 @product = Product.find(params[:id])
    5 6 end
    7
    8 def index
    • Nguyen Ngoc Lan @lannn commented Nov 19, 2014
      Master

      @phatnt I think this action should be in searches_controller

      @phatnt I think this action should be in searches_controller
    Please register or sign in to reply
  • Write
  • Preview
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or sign in to comment
Nguyen Ngoc Lan
Assignee
Nguyen Ngoc Lan @lannn
Assign to
None
Milestone
None
Assign milestone
Time tracking
2
2 participants
Reference: phatnt/venshop!3