This file contains hidden or 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
AWS_CONFIG = { | |
'access_key_id' => YOUR_ACCESS_KEY, | |
'secret_access_key' => YOUR_SECRET_ACCESS_KEY, | |
'bucket' => 'froala', | |
'acl' => 'public-read', | |
'key_start' => 'uploads/', | |
'region' => 's3' # For other regions than us-east-1, use s3-region. E.g.: s3-eu-west-1 | |
} |
This file contains hidden or 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
require 'open-uri' | |
require 'json' | |
require 'psych' | |
city = 'portsaid,egypt' | |
request = "http://api.openweathermap.org/data/2.5/weather?q=#{city}" | |
response = open(request).readlines.join | |
print Psych.dump( JSON.parse(response) ) |
This file contains hidden or 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
=render @memory_page.approved_comments | |
= simple_form_for [@memory_page, Comment.new], html: {class: 'form-inline'} do |f| | |
.form-inputs | |
.row | |
.col-md-12 | |
= f.input :comment, label: "Add Your Comment", input_html: {class: 'editable'} | |
.row#hidden_form_elements.hide //I have some JS callback that will display these fields once the parent input has been edited | |
.col-md-6 | |
= f.input :name | |
.col-md-6 |