Uno scrittoio digitale …

26 settembre 2014

The Ruby ‘Struct’ Class

Archiviato in: rails — admin @ 16:16

Riporto la definizione scritta nelle Ruby documentation:

Struct is “a convenient way to bundle a number of attributes together, using accessor methods, without having to write an explicit class.”

Esempio:

Person = Struct.new(:name, :age, :gender) do
  def greet_world
    "Hello world, my name is #{name}."
  end
  def ask_question
    "What is your favorite programming language?"
  end
end

stephanie = Person.new("Stephanie", "26", "female")

stephanie.name          # => "Stephanie"
stephanie.age           # => "26"
stephanie.gender        # => "female"

stephanie.greet_world   # => "Hello world, my name is Stephanie."
stephanie.ask_question  # => "What is your favorite programming language?"

23 settembre 2014

42

Archiviato in: rails, sapere è potere — admin @ 12:49

Ho scoperto che in un modulo di Rails che non fà altro che aggiungere metodi alla class Array è esplicitato il metodo forty_two:

module ActiveSupport #:nodoc:
  module CoreExtensions #:nodoc:
    module Array #:nodoc:
      # Makes it easier to access parts of an array.
      module Access
        # Returns the tail of the array from +position+.
        #
        #   %w( a b c d ).from(0)  # => %w( a b c d )
        #   %w( a b c d ).from(2)  # => %w( c d )
        #   %w( a b c d ).from(10) # => nil
        #   %w().from(0)           # => nil
        def from(position)
          self[position..-1]
        end

        # Returns the beginning of the array up to +position+.
        #
        #   %w( a b c d ).to(0)  # => %w( a )
        #   %w( a b c d ).to(2)  # => %w( a b c )
        #   %w( a b c d ).to(10) # => %w( a b c d )
        #   %w().to(0)           # => %w()
        def to(position)
          self[0..position]
        end

        # Equal to self[1].
        def second
          self[1]
        end

        # Equal to self[2].
        def third
          self[2]
        end

        # Equal to self[3].
        def fourth
          self[3]
        end

        # Equal to self[4].
        def fifth
          self[4]
        end

        # Equal to self[41]. Also known as accessing "the reddit".
        def forty_two
          self[41]
        end
      end
    end
  end
end

da questo ho poi scoperto altri riferimenti a Douglas Adams:
http://www.quora.com/Why-is-Array-forty_two-called-the-reddit-in-Ruby-on-Rails
http://www.reddit.com/r/its42
http://www.reddit.com/r/fortytwo/

Mitico rails.

5 settembre 2014

Rails4 sessions current practices

Archiviato in: Senza categoria — admin @ 17:45

http://stackoverflow.com/questions/2588241/rails-sessions-current-practices

The CookieStore is fast and should cover the majority of use cases. Sure you’re limited to 4kb and your data will be visible to the user, but the Rails way is to only use session for things like integer IDs and basic string values- If you’re trying to store objects or highly confidential information in session you’re probably doing it wrong.

3 settembre 2014

rails console (for showing who define helpers)

Archiviato in: Senza categoria — Tag:, — admin @ 17:36

1.9.3-p429 :001 >   helper.methods.sort.each {|m| p m.to_s + " => " + helper.method(m).to_s }

"! => #Method: ActionView::Base(BasicObject)#!"
"!= => #Method: ActionView::Base(BasicObject)#!="
"!~ => #Method: ActionView::Base(Kernel)#!~"
"<=> => #Method: ActionView::Base(Kernel)#<=>"
"== => #Method: ActionView::Base(BasicObject)#=="
"=== => #Method: ActionView::Base(Kernel)#==="
"=~ => #Method: ActionView::Base(Kernel)#=~"
"__id__ => #Method: ActionView::Base(BasicObject)#__id__"
"__send__ => #Method: ActionView::Base(BasicObject)#__send__"
"_layout_for => #Method: ActionView::Base(ActionView::Helpers::RenderingHelper)#_layout_for"
"_prepare_context => #Method: ActionView::Base(ActionView::Context)#_prepare_context"
"_routes => #Method: ActionView::Base#_routes"
"_routes= => #Method: ActionView::Base#_routes="
"_routes? => #Method: ActionView::Base#_routes?"
"_routes_context => #Method: ActionView::Base(ActionView::Helpers::UrlHelper)#_routes_context"
"_with_routes => #Method: ActionView::Base(ActionDispatch::Routing::UrlFor)#_with_routes"
"` => #Method: ActionView::Base(Object)#`"
"action_name => #Method: ActionView::Base(ActionView::Helpers::ControllerHelper)#action_name"
"acts_like? => #Method: ActionView::Base(Object)#acts_like?"
"add_gritter => #Method: ActionView::Base(Gritter::Helpers)#add_gritter"
"alert => #Method: ActionView::Base(#Module:0x000000025153e0>)#alert"
"as_json => #Method: ActionView::Base(Object)#as_json"
"asset_path => #Method: ActionView::Base(Sprockets::Helpers::RailsHelper)#asset_path"
"asset_paths => #Method: ActionView::Base(Sprockets::Helpers::RailsHelper)#asset_paths"
"assign => #Method: ActionView::Base#assign"
"assign_controller => #Method: ActionView::Base(ActionView::Helpers::ControllerHelper)#assign_controller"
"assigns => #Method: ActionView::Base#_assigns"
"assigns= => #Method: ActionView::Base#_assigns="
"atom_feed => #Method: ActionView::Base(ActionView::Helpers::AtomFeedHelper)#atom_feed"
"audio_path => #Method: ActionView::Base(ActionView::Helpers::AssetTagHelper)#audio_path"
"audio_tag => #Method: ActionView::Base(ActionView::Helpers::AssetTagHelper)#audio_tag"
"authorized_link_for => #Method: ActionView::Base(ApplicationHelper)#authorized_link_for"
"auto_discovery_link_tag => #Method: ActionView::Base(ActionView::Helpers::AssetTagHelper)#auto_discovery_link_tag"
"benchmark => #Method: ActionView::Base(ActiveSupport::Benchmarkable)#benchmark"
"binding_n => #Method: ActionView::Base(Kernel)#binding_n"
"blank? => #Method: ActionView::Base(Object)#blank?"
"breakpoint => #Method: ActionView::Base(Kernel)#debugger"
"button_tag => #Method: ActionView::Base(ActionView::Helpers::FormTagHelper)#button_tag"
"button_to => #Method: ActionView::Base(ActionView::Helpers::UrlHelper)#button_to"
"button_to_function => #Method: ActionView::Base(ActionView::Helpers::JavaScriptHelper)#button_to_function"
"cache => #Method: ActionView::Base(ActionView::Helpers::CacheHelper)#cache"
"can? => #Method: ActionView::Base(#Module:0x000000025153e0>)#can?"
"cannot? => #Method: ActionView::Base(#Module:0x000000025153e0>)#cannot?"
"capture => #Method: ActionView::Base(ActionView::Helpers::CaptureHelper)#capture"
"cdata_section => #Method: ActionView::Base(ActionView::Helpers::TagHelper)#cdata_section"
"check_box => #Method: ActionView::Base(ActionView::Helpers::FormHelper)#check_box"
"check_box_tag => #Method: ActionView::Base(ActionView::Helpers::FormTagHelper)#check_box_tag"
"class => #Method: ActionView::Base(Kernel)#class"
"class_eval => #Method: ActionView::Base(Kernel)#class_eval"
"clone => #Method: ActionView::Base(Kernel)#clone"
"collection_select => #Method: ActionView::Base(ActionView::Helpers::FormOptionsHelper)#collection_select"
"concat => #Method: ActionView::Base(ActionView::Helpers::TextHelper)#concat"
"config => #Method: ActionView::Base#_config"
"config= => #Method: ActionView::Base#_config="
"content_for => #Method: ActionView::Base(ActionView::Helpers::CaptureHelper)#content_for"
"content_for? => #Method: ActionView::Base(ActionView::Helpers::CaptureHelper)#content_for?"
"content_tag => #Method: ActionView::Base(ActionView::Helpers::TagHelper)#content_tag"
"content_tag_for => #Method: ActionView::Base(ActionView::Helpers::RecordTagHelper)#content_tag_for"
"controller => #Method: ActionView::Base(ActionView::Helpers::ControllerHelper)#_controller"
"controller= => #Method: ActionView::Base(ActionView::Helpers::ControllerHelper)#_controller="
"controller_name => #Method: ActionView::Base(ActionView::Helpers::ControllerHelper)#controller_name"
"controller_path => #Method: ActionView::Base(ActionView::Helpers::ControllerHelper)#controller_path"
"convert_to_model => #Method: ActionView::Base(ActionView::Helpers::FormHelper)#convert_to_model"
"cookies => #Method: ActionView::Base(#Module:0x000000025153e0>)#cookies"
"csrf_meta_tag => #Method: ActionView::Base(ActionView::Helpers::CsrfHelper)#csrf_meta_tags"
"csrf_meta_tags => #Method: ActionView::Base(ActionView::Helpers::CsrfHelper)#csrf_meta_tags"
"css_class => #Method: ActionView::Base(SimpleForm::ActionViewExtensions::FormHelper)#css_class"
"current_ability => #Method: ActionView::Base(#Module:0x000000025153e0>)#current_ability"
"current_cycle => #Method: ActionView::Base(ActionView::Helpers::TextHelper)#current_cycle"
"current_page? => #Method: ActionView::Base(ActionView::Helpers::UrlHelper)#current_page?"
"current_user => #Method: ActionView::Base(#Module:0x00000003fee3b0>)#current_user"
"cycle => #Method: ActionView::Base(ActionView::Helpers::TextHelper)#cycle"
"date_select => #Method: ActionView::Base(ActionView::Helpers::DateHelper)#date_select"
"datetime_select => #Method: ActionView::Base(ActionView::Helpers::DateHelper)#datetime_select"
"debug => #Method: ActionView::Base(ActionView::Helpers::DebugHelper)#debug"
"debugger => #Method: ActionView::Base(Kernel)#debugger"
"default_form_builder => #Method: ActionView::Base#default_form_builder"
"default_form_builder= => #Method: ActionView::Base#default_form_builder="
"default_url_options => #Method: ActionView::Base#default_url_options"
"default_url_options= => #Method: ActionView::Base#default_url_options="
"default_url_options? => #Method: ActionView::Base#default_url_options?"
"define_singleton_method => #Method: ActionView::Base(Kernel)#define_singleton_method"
"display => #Method: ActionView::Base(Kernel)#display"
"distance_of_time_in_words => #Method: ActionView::Base(ActionView::Helpers::DateHelper)#distance_of_time_in_words"
"distance_of_time_in_words_to_now => #Method: ActionView::Base(ActionView::Helpers::DateHelper)#time_ago_in_words"
"div_for => #Method: ActionView::Base(ActionView::Helpers::RecordTagHelper)#div_for"
"dom_class => #Method: ActionView::Base(ActionController::RecordIdentifier)#dom_class"
"dom_id => #Method: ActionView::Base(ActionController::RecordIdentifier)#dom_id"
"dup => #Method: ActionView::Base(Kernel)#dup"
"duplicable? => #Method: ActionView::Base(Object)#duplicable?"
"edit_polymorphic_path => #Method: ActionView::Base(ActionDispatch::Routing::PolymorphicRoutes)#edit_polymorphic_path"
"edit_polymorphic_url => #Method: ActionView::Base(ActionDispatch::Routing::PolymorphicRoutes)#edit_polymorphic_url"
"email_field => #Method: ActionView::Base(ActionView::Helpers::FormHelper)#email_field"
"email_field_tag => #Method: ActionView::Base(ActionView::Helpers::FormTagHelper)#email_field_tag"
"embed_authenticity_token_in_remote_forms => #Method: ActionView::Base(ActionView::Helpers::FormTagHelper)#embed_authenticity_token_in_remote_forms"
"embed_authenticity_token_in_remote_forms= => #Method: ActionView::Base(ActionView::Helpers::FormTagHelper)#embed_authenticity_token_in_remote_forms="
"enable_warnings => #Method: ActionView::Base(Kernel)#enable_warnings"
"enum_for => #Method: ActionView::Base(Kernel)#enum_for"
"eql? => #Method: ActionView::Base(Kernel)#eql?"
"equal? => #Method: ActionView::Base(BasicObject)#equal?"
"escape_double_quotes => #Method: ActionView::Base(XmlHelper)#escape_double_quotes"
"escape_javascript => #Method: ActionView::Base(ActionView::Helpers::JavaScriptHelper)#escape_javascript"
"escape_once => #Method: ActionView::Base(ActionView::Helpers::TagHelper)#escape_once"
"escape_single_quotes => #Method: ActionView::Base(XmlHelper)#escape_single_quotes"
"eval_js => #Method: ActionView::Base(Object)#eval_js"
"excerpt => #Method: ActionView::Base(ActionView::Helpers::TextHelper)#excerpt"
"extend => #Method: ActionView::Base(Kernel)#extend"
"extend_gritter => #Method: ActionView::Base(Gritter::Helpers)#extend_gritter"
"favicon_link_tag => #Method: ActionView::Base(ActionView::Helpers::AssetTagHelper)#favicon_link_tag"
"field_error_proc => #Method: ActionView::Base#field_error_proc"
"field_error_proc= => #Method: ActionView::Base#field_error_proc="
"field_set_tag => #Method: ActionView::Base(ActionView::Helpers::FormTagHelper)#field_set_tag"
"fields_for => #Method: ActionView::Base(ActionView::Helpers::FormHelper)#fields_for"
"file_field => #Method: ActionView::Base(ActionView::Helpers::FormHelper)#file_field"
"file_field_tag => #Method: ActionView::Base(ActionView::Helpers::FormTagHelper)#file_field_tag"
"flash => #Method: ActionView::Base(ActionView::Helpers::ControllerHelper)#flash"
"flush_output_buffer => #Method: ActionView::Base(ActionView::Helpers::CaptureHelper)#flush_output_buffer"
"font_path => #Method: ActionView::Base(Sprockets::Helpers::RailsHelper)#font_path"
"form_authenticity_token => #Method: ActionView::Base(#Module:0x000000025153e0>)#form_authenticity_token"
"form_for => #Method: ActionView::Base(ActionView::Helpers::FormHelper)#form_for"
"form_tag => #Method: ActionView::Base(ActionView::Helpers::FormTagHelper)#form_tag"
"formats => #Method: ActionView::Base#formats"
"formats= => #Method: ActionView::Base#formats="
"freeze => #Method: ActionView::Base(Kernel)#freeze"
"frozen? => #Method: ActionView::Base(Kernel)#frozen?"
"gem => #Method: ActionView::Base(Kernel)#gem"
"gflash => #Method: ActionView::Base(Gritter::Helpers)#gflash"
"gritter_cache_message_for => #Method: ActionView::Base(ClabShippingsHelper)#gritter_cache_message_for"
"grouped_collection_select => #Method: ActionView::Base(ActionView::Helpers::FormOptionsHelper)#grouped_collection_select"
"grouped_options_for_select => #Method: ActionView::Base(ActionView::Helpers::FormOptionsHelper)#grouped_options_for_select"
"hash => #Method: ActionView::Base(Kernel)#hash"
"headers => #Method: ActionView::Base(ActionView::Helpers::ControllerHelper)#headers"
"helpers => #Method: ActionView::Base#helpers"
"helpers= => #Method: ActionView::Base#helpers="
"helpers? => #Method: ActionView::Base#helpers?"
"hidden_field => #Method: ActionView::Base(ActionView::Helpers::FormHelper)#hidden_field"
"hidden_field_tag => #Method: ActionView::Base(ActionView::Helpers::FormTagHelper)#hidden_field_tag"
"highlight => #Method: ActionView::Base(ActionView::Helpers::TextHelper)#highlight"
"html_safe? => #Method: ActionView::Base(Object)#html_safe?"
"image_alt => #Method: ActionView::Base(ActionView::Helpers::AssetTagHelper)#image_alt"
"image_path => #Method: ActionView::Base(Sprockets::Helpers::RailsHelper)#image_path"
"image_submit_tag => #Method: ActionView::Base(ActionView::Helpers::FormTagHelper)#image_submit_tag"
"image_tag => #Method: ActionView::Base(ActionView::Helpers::AssetTagHelper)#image_tag"
"in? => #Method: ActionView::Base(Object)#in?"
"initialize_clone => #Method: ActionView::Base(Kernel)#initialize_clone"
"initialize_dup => #Method: ActionView::Base(Kernel)#initialize_dup"
"inspect => #Method: ActionView::Base(Kernel)#inspect"
"instance_eval => #Method: ActionView::Base(BasicObject)#instance_eval"
"instance_exec => #Method: ActionView::Base(BasicObject)#instance_exec"
"instance_of? => #Method: ActionView::Base(Kernel)#instance_of?"
"instance_values => #Method: ActionView::Base(Object)#instance_values"
"instance_variable_defined? => #Method: ActionView::Base(Kernel)#instance_variable_defined?"
"instance_variable_get => #Method: ActionView::Base(Kernel)#instance_variable_get"
"instance_variable_names => #Method: ActionView::Base(Object)#instance_variable_names"
"instance_variable_set => #Method: ActionView::Base(Kernel)#instance_variable_set"
"instance_variables => #Method: ActionView::Base(Kernel)#instance_variables"
"is_a? => #Method: ActionView::Base(Kernel)#is_a?"
"j => #Method: ActionView::Base(ActionView::Helpers::JavaScriptHelper)#escape_javascript"
"javascript_cdata_section => #Method: ActionView::Base(ActionView::Helpers::JavaScriptHelper)#javascript_cdata_section"
"javascript_include_tag => #Method: ActionView::Base(Sprockets::Helpers::RailsHelper)#javascript_include_tag"
"javascript_path => #Method: ActionView::Base(Sprockets::Helpers::RailsHelper)#javascript_path"
"javascript_tag => #Method: ActionView::Base(ActionView::Helpers::JavaScriptHelper)#javascript_tag"
"js => #Method: ActionView::Base(Gritter::Helpers)#js"
"kind_of? => #Method: ActionView::Base(Kernel)#kind_of?"
"l => #Method: ActionView::Base(ActionView::Helpers::TranslationHelper)#localize"
"label => #Method: ActionView::Base(ActionView::Helpers::FormHelper)#label"
"label_tag => #Method: ActionView::Base(ActionView::Helpers::FormTagHelper)#label_tag"
"ldap_auth => #Method: ActionView::Base(LdapHelper)#ldap_auth"
"link_to => #Method: ActionView::Base(ActionView::Helpers::UrlHelper)#link_to"
"link_to_add_fields => #Method: ActionView::Base(ApplicationHelper)#link_to_add_fields"
"link_to_function => #Method: ActionView::Base(ActionView::Helpers::JavaScriptHelper)#link_to_function"
"link_to_if => #Method: ActionView::Base(ActionView::Helpers::UrlHelper)#link_to_if"
"link_to_next_page => #Method: ActionView::Base(Kaminari::ActionViewExtension)#link_to_next_page"
"link_to_previous_page => #Method: ActionView::Base(Kaminari::ActionViewExtension)#link_to_previous_page"
"link_to_remove_fields => #Method: ActionView::Base(ApplicationHelper)#link_to_remove_fields"
"link_to_unless => #Method: ActionView::Base(ActionView::Helpers::UrlHelper)#link_to_unless"
"link_to_unless_current => #Method: ActionView::Base(ActionView::Helpers::UrlHelper)#link_to_unless_current"
"load => #Method: ActionView::Base(ActiveSupport::Dependencies::Loadable)#load"
"load_dependency => #Method: ActionView::Base(ActiveSupport::Dependencies::Loadable)#load_dependency"
"loader => #Method: ActionView::Base(ApplicationHelper)#loader"
"locale => #Method: ActionView::Base#locale"
"locale= => #Method: ActionView::Base#locale="
"localize => #Method: ActionView::Base(ActionView::Helpers::TranslationHelper)#localize"
"logger => #Method: ActionView::Base(ActionView::Helpers::ControllerHelper)#logger"
"lookup_context => #Method: ActionView::Base#lookup_context"
"mail_to => #Method: ActionView::Base(ActionView::Helpers::UrlHelper)#mail_to"
"method => #Method: ActionView::Base(Kernel)#method"
"methods => #Method: ActionView::Base(Kernel)#methods"
"new_polymorphic_path => #Method: ActionView::Base(ActionDispatch::Routing::PolymorphicRoutes)#new_polymorphic_path"
"new_polymorphic_url => #Method: ActionView::Base(ActionDispatch::Routing::PolymorphicRoutes)#new_polymorphic_url"
"nil? => #Method: ActionView::Base(Kernel)#nil?"
"notice => #Method: ActionView::Base(#Module:0x000000025153e0>)#notice"
"number_field => #Method: ActionView::Base(ActionView::Helpers::FormHelper)#number_field"
"number_field_tag => #Method: ActionView::Base(ActionView::Helpers::FormTagHelper)#number_field_tag"
"number_to_currency => #Method: ActionView::Base(ActionView::Helpers::NumberHelper)#number_to_currency"
"number_to_human => #Method: ActionView::Base(ActionView::Helpers::NumberHelper)#number_to_human"
"number_to_human_size => #Method: ActionView::Base(ActionView::Helpers::NumberHelper)#number_to_human_size"
"number_to_percentage => #Method: ActionView::Base(ActionView::Helpers::NumberHelper)#number_to_percentage"
"number_to_phone => #Method: ActionView::Base(ActionView::Helpers::NumberHelper)#number_to_phone"
"number_with_delimiter => #Method: ActionView::Base(ActionView::Helpers::NumberHelper)#number_with_delimiter"
"number_with_precision => #Method: ActionView::Base(ActionView::Helpers::NumberHelper)#number_with_precision"
"object_id => #Method: ActionView::Base(Kernel)#object_id"
"option_groups_from_collection_for_select => #Method: ActionView::Base(ActionView::Helpers::FormOptionsHelper)#option_groups_from_collection_for_select"
"options_for_select => #Method: ActionView::Base(ActionView::Helpers::FormOptionsHelper)#options_for_select"
"options_from_collection_for_select => #Method: ActionView::Base(ActionView::Helpers::FormOptionsHelper)#options_from_collection_for_select"
"output_buffer => #Method: ActionView::Base(ActionView::Context)#output_buffer"
"output_buffer= => #Method: ActionView::Base(ActionView::Context)#output_buffer="
"page_entries_info => #Method: ActionView::Base(Kaminari::ActionViewExtension)#page_entries_info"
"paginate => #Method: ActionView::Base(Kaminari::ActionViewExtension)#paginate"
"params => #Method: ActionView::Base(ActionView::Helpers::ControllerHelper)#params"
"password_field => #Method: ActionView::Base(ActionView::Helpers::FormHelper)#password_field"
"password_field_tag => #Method: ActionView::Base(ActionView::Helpers::FormTagHelper)#password_field_tag"
"path_to_asset => #Method: ActionView::Base(Sprockets::Helpers::RailsHelper)#asset_path"
"path_to_audio => #Method: ActionView::Base(ActionView::Helpers::AssetTagHelper)#audio_path"
"path_to_font => #Method: ActionView::Base(Sprockets::Helpers::RailsHelper)#font_path"
"path_to_image => #Method: ActionView::Base(Sprockets::Helpers::RailsHelper)#image_path"
"path_to_javascript => #Method: ActionView::Base(Sprockets::Helpers::RailsHelper)#javascript_path"
"path_to_stylesheet => #Method: ActionView::Base(Sprockets::Helpers::RailsHelper)#stylesheet_path"
"path_to_video => #Method: ActionView::Base(ActionView::Helpers::AssetTagHelper)#video_path"
"phone_field => #Method: ActionView::Base(ActionView::Helpers::FormHelper)#telephone_field"
"phone_field_tag => #Method: ActionView::Base(ActionView::Helpers::FormTagHelper)#telephone_field_tag"
"pluralize => #Method: ActionView::Base(ActionView::Helpers::TextHelper)#pluralize"
"polymorphic_path => #Method: ActionView::Base(ActionDispatch::Routing::PolymorphicRoutes)#polymorphic_path"
"polymorphic_url => #Method: ActionView::Base(ActionDispatch::Routing::PolymorphicRoutes)#polymorphic_url"
"presence => #Method: ActionView::Base(Object)#presence"
"present? => #Method: ActionView::Base(Object)#present?"
"pretty_inspect => #Method: ActionView::Base(Kernel)#pretty_inspect"
"pretty_print => #Method: ActionView::Base(PP::ObjectMixin)#pretty_print"
"pretty_print_cycle => #Method: ActionView::Base(PP::ObjectMixin)#pretty_print_cycle"
"pretty_print_inspect => #Method: ActionView::Base(PP::ObjectMixin)#pretty_print_inspect"
"pretty_print_instance_variables => #Method: ActionView::Base(PP::ObjectMixin)#pretty_print_instance_variables"
"private_methods => #Method: ActionView::Base(Kernel)#private_methods"
"protect_against_forgery? => #Method: ActionView::Base(#Module:0x000000025153e0>)#protect_against_forgery?"
"protected_methods => #Method: ActionView::Base(Kernel)#protected_methods"
"provide => #Method: ActionView::Base(ActionView::Helpers::CaptureHelper)#provide"
"psych_to_yaml => #Method: ActionView::Base(Object)#psych_to_yaml"
"psych_y => #Method: ActionView::Base(Kernel)#psych_y"
"public_method => #Method: ActionView::Base(Kernel)#public_method"
"public_methods => #Method: ActionView::Base(Kernel)#public_methods"
"public_send => #Method: ActionView::Base(Kernel)#public_send"
"quietly => #Method: ActionView::Base(Kernel)#quietly"
"radio_button => #Method: ActionView::Base(ActionView::Helpers::FormHelper)#radio_button"
"radio_button_tag => #Method: ActionView::Base(ActionView::Helpers::FormTagHelper)#radio_button_tag"
"range_field => #Method: ActionView::Base(ActionView::Helpers::FormHelper)#range_field"
"range_field_tag => #Method: ActionView::Base(ActionView::Helpers::FormTagHelper)#range_field_tag"
"raw => #Method: ActionView::Base(ActionView::Helpers::OutputSafetyHelper)#raw"
"recent_customers => #Method: ActionView::Base(ApplicationHelper)#recent_customers"
"recent_users => #Method: ActionView::Base(ApplicationHelper)#recent_users"
"record_key_for_dom_id => #Method: ActionView::Base(ActionController::RecordIdentifier)#record_key_for_dom_id"
"rel_next_prev_link_tags => #Method: ActionView::Base(Kaminari::ActionViewExtension)#rel_next_prev_link_tags"
"remove_gritter => #Method: ActionView::Base(Gritter::Helpers)#remove_gritter"
"render => #Method: ActionView::Base(ActionView::Helpers::RenderingHelper)#render"
"request => #Method: ActionView::Base(ActionView::Helpers::ControllerHelper)#_request"
"request= => #Method: ActionView::Base(ActionView::Helpers::ControllerHelper)#_request="
"request_forgery_protection_token => #Method: ActionView::Base(ActionView::Helpers::ControllerHelper)#request_forgery_protection_token"
"require => #Method: ActionView::Base(ActiveSupport::Dependencies::Loadable)#require"
"require_association => #Method: ActionView::Base(ActiveSupport::Dependencies::Loadable)#require_association"
"require_dependency => #Method: ActionView::Base(ActiveSupport::Dependencies::Loadable)#require_dependency"
"require_or_load => #Method: ActionView::Base(ActiveSupport::Dependencies::Loadable)#require_or_load"
"reset_cycle => #Method: ActionView::Base(ActionView::Helpers::TextHelper)#reset_cycle"
"respond_to? => #Method: ActionView::Base(Kernel)#respond_to?"
"respond_to_missing? => #Method: ActionView::Base(Kernel)#respond_to_missing?"
"response => #Method: ActionView::Base(ActionView::Helpers::ControllerHelper)#response"
"safe_concat => #Method: ActionView::Base(ActionView::Helpers::TextHelper)#safe_concat"
"safe_join => #Method: ActionView::Base(ActionView::Helpers::OutputSafetyHelper)#safe_join"
"sanitize => #Method: ActionView::Base(ActionView::Helpers::SanitizeHelper)#sanitize"
"sanitize_css => #Method: ActionView::Base(ActionView::Helpers::SanitizeHelper)#sanitize_css"
"sanitize_dom_id => #Method: ActionView::Base(ActionController::RecordIdentifier)#sanitize_dom_id"
"search_field => #Method: ActionView::Base(ActionView::Helpers::FormHelper)#search_field"
"search_field_tag => #Method: ActionView::Base(ActionView::Helpers::FormTagHelper)#search_field_tag"
"select => #Method: ActionView::Base(ActionView::Helpers::FormOptionsHelper)#select"
"select_date => #Method: ActionView::Base(ActionView::Helpers::DateHelper)#select_date"
"select_datetime => #Method: ActionView::Base(ActionView::Helpers::DateHelper)#select_datetime"
"select_day => #Method: ActionView::Base(ActionView::Helpers::DateHelper)#select_day"
"select_hour => #Method: ActionView::Base(ActionView::Helpers::DateHelper)#select_hour"
"select_minute => #Method: ActionView::Base(ActionView::Helpers::DateHelper)#select_minute"
"select_month => #Method: ActionView::Base(ActionView::Helpers::DateHelper)#select_month"
"select_second => #Method: ActionView::Base(ActionView::Helpers::DateHelper)#select_second"
"select_tag => #Method: ActionView::Base(ActionView::Helpers::FormTagHelper)#select_tag"
"select_time => #Method: ActionView::Base(ActionView::Helpers::DateHelper)#select_time"
"select_year => #Method: ActionView::Base(ActionView::Helpers::DateHelper)#select_year"
"send => #Method: ActionView::Base(Kernel)#send"
"session => #Method: ActionView::Base(ActionView::Helpers::ControllerHelper)#session"
"side_bar_links => #Method: ActionView::Base(ApplicationHelper)#side_bar_links"
"silence => #Method: ActionView::Base(ActiveSupport::Benchmarkable)#silence"
"silence_stderr => #Method: ActionView::Base(Kernel)#silence_stderr"
"silence_stream => #Method: ActionView::Base(Kernel)#silence_stream"
"silence_warnings => #Method: ActionView::Base(Kernel)#silence_warnings"
"simple_fields_for => #Method: ActionView::Base(SimpleForm::ActionViewExtensions::FormHelper)#simple_fields_for"
"simple_form_for => #Method: ActionView::Base(SimpleForm::ActionViewExtensions::FormHelper)#simple_form_for"
"simple_format => #Method: ActionView::Base(ActionView::Helpers::TextHelper)#simple_format"
"singleton_class => #Method: ActionView::Base(Kernel)#singleton_class"
"singleton_methods => #Method: ActionView::Base(Kernel)#singleton_methods"
"streaming_completion_on_exception => #Method: ActionView::Base#streaming_completion_on_exception"
"streaming_completion_on_exception= => #Method: ActionView::Base#streaming_completion_on_exception="
"strip_links => #Method: ActionView::Base(ActionView::Helpers::SanitizeHelper)#strip_links"
"strip_tags => #Method: ActionView::Base(ActionView::Helpers::SanitizeHelper)#strip_tags"
"stylesheet_link_tag => #Method: ActionView::Base(Sprockets::Helpers::RailsHelper)#stylesheet_link_tag"
"stylesheet_path => #Method: ActionView::Base(Sprockets::Helpers::RailsHelper)#stylesheet_path"
"submit_tag => #Method: ActionView::Base(ActionView::Helpers::FormTagHelper)#submit_tag"
"suppress => #Method: ActionView::Base(Kernel)#suppress"
"suppress_warnings => #Method: ActionView::Base(Kernel)#suppress_warnings"
"t => #Method: ActionView::Base(ActionView::Helpers::TranslationHelper)#translate"
"tag => #Method: ActionView::Base(ActionView::Helpers::TagHelper)#tag"
"taint => #Method: ActionView::Base(Kernel)#taint"
"tainted? => #Method: ActionView::Base(Kernel)#tainted?"
"tap => #Method: ActionView::Base(Kernel)#tap"
"telephone_field => #Method: ActionView::Base(ActionView::Helpers::FormHelper)#telephone_field"
"telephone_field_tag => #Method: ActionView::Base(ActionView::Helpers::FormTagHelper)#telephone_field_tag"
"text_area => #Method: ActionView::Base(ActionView::Helpers::FormHelper)#text_area"
"text_area_tag => #Method: ActionView::Base(ActionView::Helpers::FormTagHelper)#text_area_tag"
"text_field => #Method: ActionView::Base(ActionView::Helpers::FormHelper)#text_field"
"text_field_tag => #Method: ActionView::Base(ActionView::Helpers::FormTagHelper)#text_field_tag"
"time_ago_in_words => #Method: ActionView::Base(ActionView::Helpers::DateHelper)#time_ago_in_words"
"time_select => #Method: ActionView::Base(ActionView::Helpers::DateHelper)#time_select"
"time_tag => #Method: ActionView::Base(ActionView::Helpers::DateHelper)#time_tag"
"time_zone_options_for_select => #Method: ActionView::Base(ActionView::Helpers::FormOptionsHelper)#time_zone_options_for_select"
"time_zone_select => #Method: ActionView::Base(ActionView::Helpers::FormOptionsHelper)#time_zone_select"
"to_enum => #Method: ActionView::Base(Kernel)#to_enum"
"to_json => #Method: ActionView::Base(Object)#to_json"
"to_param => #Method: ActionView::Base(Object)#to_param"
"to_query => #Method: ActionView::Base(Object)#to_query"
"to_s => #Method: ActionView::Base(Kernel)#to_s"
"to_yaml => #Method: ActionView::Base(Object)#psych_to_yaml"
"to_yaml_properties => #Method: ActionView::Base(Object)#to_yaml_properties"
"translate => #Method: ActionView::Base(ActionView::Helpers::TranslationHelper)#translate"
"truncate => #Method: ActionView::Base(ActionView::Helpers::TextHelper)#truncate"
"trust => #Method: ActionView::Base(Kernel)#trust"
"try => #Method: ActionView::Base(Object)#try"
"unloadable => #Method: ActionView::Base(ActiveSupport::Dependencies::Loadable)#unloadable"
"untaint => #Method: ActionView::Base(Kernel)#untaint"
"untrust => #Method: ActionView::Base(Kernel)#untrust"
"untrusted? => #Method: ActionView::Base(Kernel)#untrusted?"
"url_field => #Method: ActionView::Base(ActionView::Helpers::FormHelper)#url_field"
"url_field_tag => #Method: ActionView::Base(ActionView::Helpers::FormTagHelper)#url_field_tag"
"url_for => #Method: ActionView::Base(ActionView::Helpers::UrlHelper)#url_for"
"url_options => #Method: ActionView::Base(ActionView::Helpers::UrlHelper)#url_options"
"utf8_enforcer_tag => #Method: ActionView::Base(ActionView::Helpers::FormTagHelper)#utf8_enforcer_tag"
"video_path => #Method: ActionView::Base(ActionView::Helpers::AssetTagHelper)#video_path"
"video_tag => #Method: ActionView::Base(ActionView::Helpers::AssetTagHelper)#video_tag"
"view_flow => #Method: ActionView::Base(ActionView::Context)#view_flow"
"view_flow= => #Method: ActionView::Base(ActionView::Context)#view_flow="
"view_paths => #Method: ActionView::Base#view_paths"
"view_paths= => #Method: ActionView::Base#view_paths="
"view_renderer => #Method: ActionView::Base#view_renderer"
"view_renderer= => #Method: ActionView::Base#view_renderer="
"with_custom_field_error_proc => #Method: ActionView::Base(SimpleForm::ActionViewExtensions::FormHelper)#with_custom_field_error_proc"
"with_options => #Method: ActionView::Base(Object)#with_options"
"with_output_buffer => #Method: ActionView::Base(ActionView::Helpers::CaptureHelper)#with_output_buffer"
"with_warnings => #Method: ActionView::Base(Kernel)#with_warnings"
"word_wrap => #Method: ActionView::Base(ActionView::Helpers::TextHelper)#word_wrap"

Navigazione pazzesca

Archiviato in: web — Tag:, — admin @ 11:49

In questo http://danshultz.github.io/talks/mastering_activerecord_arel/ sono disponibili delle informazioni
sull’uso di arel nei modelli rails per le query un pò più complesse.
Lo cito non tanto per le info, già largamente disponibili sulla pagina di GitHub, ma quanto per lo straordinario modo per fruirle.

Il framework usato è reveal-js.

Funziona con WordPress