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
def replace_value_for(extended_field_element_name, value, field = nil) | |
logger.debug("what is extended_content: " + self.extended_content.inspect) | |
# Fetch the existing data from XML | |
sandpit_data = structured_extended_content | |
logger.debug("what is sandpit_data: " + sandpit_data.inspect) | |
# Replace the value we're changing | |
# The value needs to be nested to form an array if necessary, since we ALWAYS pass in an array. | |
if field.is_a_choice? && !value.is_a?(Array) |
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
def replace_value_for(extended_field_element_name, value, field = nil) | |
logger.debug("what is extended_content: " + self.extended_content.inspect) | |
# Fetch the existing data from XML | |
sandpit_data = structured_extended_content | |
logger.debug("what is sandpit_data: " + sandpit_data.inspect) | |
# Replace the value we're changing | |
# The value needs to be nested to form an array if necessary, since we ALWAYS pass in an array. | |
if field.is_a_choice? && !value.is_a?(Array) |
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
$ script/console # put the word production after this if you are normally running in production mode | |
... | |
>> require 'net/http' | |
>> require 'uri' | |
>> require 'socket' | |
>> url = URI.parse("http://no.wikipedia.org/wiki/Valentin_F%C3%BCrst") | |
>> headers = Object.const_defined?('SITE_URL') ? { "User-Agent" => "#{SITE_URL} link checking mechanism via Ruby Net/HTTP" } : { "User-Agent" => "Ruby Net/HTTp used for link checking mechanism" } | |
>> http = Net::HTTP.new(url.host, (url.scheme == 'https') ? 443 : 80) | |
>> response = http.request_head(url.path, headers) # copy and paste what this returns back into ticket | |
>> response = http.request_get(url.path, headers) {|r|} # copy and paste what this returns back into ticket |
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
<اراء_الاخرين xml_element_name=\"dc:subject\">a</اراء_الاخرين> | |
... | |
<رعاة_الحدث xml_element_name=\"dc:subject\">b</رعاة_الحدث> |
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
>> ef1 = ExtendedField.find_by_label("اراء الاخرين") | |
ef1 = ExtendedField.find_by_label("اراء الاخرين") | |
=> #<ExtendedField id: 23, label: "اراء الاخرين ", xml_element_name: "dc:subject", xsi_type: nil, multiple: false, description: nil, created_at: "2010-08-18 17:45:08", updated_at: "2010-08-18 17:45:14", import_synonyms: nil, example: nil, ftype: "text", user_choice_addition: nil, dont_link_choice_values: nil> | |
>> ef1.label_for_params | |
ef1.label_for_params | |
=> "اراء_الاخرين_" |
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 list | |
*** LOCAL GEMS *** | |
actionmailer (2.3.5) | |
actionpack (2.3.5) | |
activerecord (2.3.5) | |
activeresource (2.3.5) | |
activesupport (2.3.5) | |
addressable (2.2.4) |
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
(function($) { | |
var app = $.sammy('#main', function() { | |
this.use(Sammy.Handlebars, 'hb'); | |
// this.use('Template'); | |
// get providers | |
// append provider title | |
// create ul | |
// render each of the sources of each provider as li | |
// use the correct template for the source type |
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
(function($) { | |
var app = $.sammy('#main', function() { | |
this.use(Sammy.Handlebars, 'hb'); | |
this.around(function(callback) { | |
var context = this; | |
this.load('data/providers.json') | |
.then(function(providers) { | |
context.providers = providers; |
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
<% #thanks to enable_css, user can avoid this css to be loaded | |
if enable_css == true %> | |
<% content_for :head do %> | |
<%= stylesheet_link_tag 'gmaps4rails' %> | |
<% end %> | |
<% end %> | |
<% content_for :scripts do %> | |
<% if enable_js == true %> | |
<% @provider = options['map_options'] && options['map_options']['provider'] ? options['map_options']['provider'] : nil -%> | |
<% case @provider |
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
-- you'll need a users table with corresponding roles for ids 1-6 | |
-- | |
-- Table structure for table `roles` | |
-- | |
DROP TABLE IF EXISTS `roles`; | |
/*!40101 SET @saved_cs_client = @@character_set_client */; | |
/*!40101 SET character_set_client = utf8 */; | |
CREATE TABLE `roles` ( |