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 YourController < ApplicationController | |
def my_json | |
response, @document = get_solr_response_for_doc_id | |
render :text => @document.my_json, :layout => false | |
end | |
def our_json | |
response, @document = get_solr_response_for_doc_id | |
render :text => @document.export_as(:our_json), :layout => false | |
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
<div id="searchbox"> | |
<h2 class="search"><%= label_tag(:q, "Search ") %></h2> | |
<% form_tag root_path, :method => :get do %> | |
<span id="search_box_and_link"> | |
<%= text_field_tag(:q, localized_params[:q], :class=>"search") %> | |
</span> | |
<noscript> | |
<%= label_tag(:search_field, " in ") %> | |
<%= select_tag(:search_field, options_for_select(search_fields, h(localized_params[:search_field])), :title => "Targeted search options") %> | |
</noscript> |
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
# Entering in tabs as \t so that it's easier to understand where the tab | |
mybuffer = "1\tabc\txyz\tjan1 | |
\tdef\tlmn\tfeb1 | |
2\tamy\tmorgan\tmay1 | |
\tnick\tcary\tmay6" | |
test_hash = {} | |
gid = "" | |
#Split on new line so each line | |
mybuffer.split(/\n/).each do |line| | |
#split the line on the \t (tab) character so that we have 4 columns (groupid, first name, last name, birthday) |
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
#this is your output buffer simulated in a hash | |
mybuffer = {"1"=>[{:parser_first_name=>"abc",:parser_last_name=>"xyz",:parser_bday=>"jan1"}, | |
{:parser_first_name=>"def",:parser_last_name=>"lmn",:parser_bday=>"feb1"}], | |
"2"=>[{:parser_first_name=>"amy",:parser_last_name=>"morgan",:parser_bday=>"may1"}, | |
{:parser_first_name=>"nick",:parser_last_name=>"cary",:parser_bday=>"may6"}] | |
} | |
test_hash = {} | |
mybuffer.each do |groupid,people| | |
people.each do |person| |
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
<html> | |
<body> | |
<%= some_method %> | |
</body> | |
</html> |
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
<%= some_text("LOCATION1") %> | |
<!-- This will only load once, and fail upon refresh --> |
NewerOlder