##Field Journel Docs
We will document all software development by following this pattern.
git clone https://github.com/Paradigmisr/field_journel_docs.git
When creating new files follow this pattern
Routing: append Routing.md
| POST /api/v1/scouts/sign_in HTTP/1.1 | |
| Accept: */* | |
| Accept-Encoding: gzip, deflate | |
| Content-Length: 0 | |
| Host: staging.fieldjournal.io | |
| User-Agent: HTTPie/0.8.0 | |
| email: [email protected] | |
| password: rainflood | |
| class Api::V1::Scout::SessionsController < Devise::SessionsController | |
| skip_before_filter :verify_authenticity_token | |
| prepend_before_filter :allow_params_authentication!, only: :create | |
| prepend_before_filter :require_no_authentication, :only => [:create ] | |
| include Devise::Controllers::Helpers | |
| respond_to :json | |
| def create | |
| if correct_headers? |
| $(document).on("click", "#menu", -> | |
| $( '.off-canvas-wrap' ).foundation('offcanvas', 'show', 'move-right'); | |
| false | |
| ) | |
| $(document).foundation({ | |
| offcanvas : { | |
| open_method : 'move', | |
| close_on_click : true | |
| } |
| require 'test_helper' | |
| class ScoutTest < ActiveSupport::TestCase | |
| test | |
| end |
##Field Journel Docs
We will document all software development by following this pattern.
git clone https://github.com/Paradigmisr/field_journel_docs.git
When creating new files follow this pattern
Routing: append Routing.md
| # The original method | |
| def create_report_identifier | |
| field = Field.find(self.field_id) | |
| field_name = field.field_name | |
| report_date = self.date.to_s | |
| self.report_identifier_id = field_name << ' ' << report_date | |
| end | |
| # the decoupled version | |
| # law of demeter |
| # this request will show you a headcount of 10 | |
| https://api.meetup.com/2/event/5898549\?sign\=true\&key\=59512b1f5939553e4e7962a15154c | |
| # this request will show you the attendance *NOTICE* the members id's are | |
| # missing | |
| https://api.meetup.com/momsmeetupofco/events/5898549/attendance%5C?sign%5C=true%5C&key%5C=59512b1f5939553e4e7962a15154c | |
| # Same attendance request with filter=all | |
| http https://api.meetup.com/momsmeetupofco/events/5898549/attendance\?sign\=true\&key\=59512b1f5939553e4e7962a15154c\&filter\=all |
| require "minitest/autorun" | |
| class Archeology | |
| #The method 'function' takes a single argument. The argument must be a collection, | |
| #or at least something enumerble since the inject method is used. Inject's | |
| #argument is an accumulator the block proceding has two interpolations. The | |
| #first is injects accumulator, an empty hash. The second "val" will iterate thru | |
| #the collection given to the function method. The block of code that follows |
| require "minitest/autorun" | |
| class Archeology | |
| #The method 'function' takes a single argument. The argument must be a collection, | |
| #or at least something enumerble since the inject method is used. Inject's | |
| #argument is an accumulator the block proceding has two interpolations. The | |
| #first is injects accumulator, an empty hash. The second "val" will iterate thru | |
| #the collection given to the function method. The block of code that follows | |
| #does something really funny. It begins to populate the empty hash or |
| require 'net/https' | |
| require 'uri' | |
| require 'json' | |
| API_KEY = '59a3d0192d16da2a2d739d0c9d25fdf4' | |
| CITY = 'seattle' | |
| uri = URI.parse("https://api.flickr.com/services/rest/?method=flickr.photos.search&api_key=#{API_KEY}&tags=#{CITY}&safe_search=1&per_page=10&page=1&format=json&nojsoncallback=1") | |
| http = Net::HTTP.new(uri.host, uri.port) | |
| http.use_ssl = true |