This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
class Industry < ActiveResource::Base | |
self.site = "http://my.site.com" | |
self.prefix = "prefix/api/" | |
end |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<nav class="pagination"> | |
<ul> | |
{% if paginate.current_page > 1 %} | |
<li> | |
<a href="?page=1">first</a> | |
</li> | |
{% endif %} | |
{% if paginate.previous_page %} | |
<li> | |
<a href="?page={{paginate.previous_page}}" rel="prev">prev.</a> |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
class SearchController < ApplicationController | |
include Locomotive::Routing::SiteDispatcher | |
include Locomotive::Render | |
def index | |
@page = Locomotive::Page.where(:handle => 'search-results').first | |
results = Locomotive::ContentEntry.fulltext_search(params[:search]) | |
@drops_results = Liquid::Drops::ResultsDrop.new(results) | |
render_locomotive_page @page, { "search_results" => @drops_results } | |
end |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
gem 'mongoid_fulltext', '0.6.1' |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#encoding: utf-8 | |
::STOP_WORDS = Hash[[ | |
"alors", "au", "aucuns", "aussi", "autre", "avant", "avec", "avoir", | |
"bon", "car", "ce", "cela", "ces", "ceux", "chaque", "ci", "comme", "comment", "dans", "des", "du", | |
"dedans", "dehors", "depuis", "deux", "devrait", "doit", "donc", "dos", "droite", "début", "elle", | |
"elles", "en", "encore", "essai", "est", "et", "eu", "fait", "faites", "fois", "font", | |
"force", "haut", "hors", "ici", "il", "ils", "je juste", "la", "le", "les", "leur", "là", "ma", "maintenant", | |
"mais", "mes", "mine", "moins", "mon", "mot", "même", "ni", "nommés", "notre", "nous", "nouveaux", "ou", "où", | |
"par", "parce", "parole", "pas", "personnes", "peut", "peu", "pièce", "plupart", "pour", "pourquoi", "quand", "que", |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#topSearch.right | |
%form#searchform{:action => "/#{locale}/search", :method => "get", :role => "search"} | |
%label.assistive-text{:for => "search"}= I18n.t("common.header.search_label") | |
%input#search{:name => "search", :placeholder => I18n.t("common.header.search_placeholder"), :type => "search", :value => ""}/ | |
%input#searchSubmit{:type => "submit", :value => "Search"}/ |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
{% extends 'parent' %} | |
<h1>{{ page.title }}</h1> | |
{% if search_results.size == 0 %} | |
<p><strong>There is no result</strong></p> | |
{% endif %} | |
{% for result in search_results %} | |
{% case locale %} | |
{% when "fr" %} | |
{% capture url %}/index/{{result._permalink}}{% endcapture %} | |
{% else %} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
RAILS_ENV=staging bundle exec rake 'assets:precompile' | |
WARNING: Use strings for Figaro configuration. 647730745310662 was converted to "647730745310662". | |
WARNING: Use strings for Figaro configuration. 22225 was converted to "22225". | |
/Users/cedric/.rvm/rubies/ruby-2.0.0-p451/bin/ruby /Users/cedric/.rvm/gems/ruby-2.0.0-p451@apptweak/bin/rake assets:precompile:all RAILS_ENV=staging RAILS_GROUPS=assets | |
WARNING: Use strings for Figaro configuration. 647730745310662 was converted to "647730745310662". | |
WARNING: Use strings for Figaro configuration. 22225 was converted to "22225". | |
AssetSync: using /Users/cedric/Code/apptweak/config/initializers/asset_sync.rb | |
AssetSync: Syncing. | |
rake aborted! | |
Excon::Errors::SocketError: XML declaration allowed only at the start of the document (Nokogiri::XML::SyntaxError) |
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.