helper_method

helper_method(*methods) Instance Public methods

render

render(view, locals, buffer=nil, &block) Instance Public methods Render a template. If the template was not compiled yet, it is done exactly before rendering. This method is instrumented as â!render_template.action_viewâ. Notice that we use a bang in this instrumentation because you don't want to consume this in production. This is only slow if it's being listened to.

get_callbacks

get_callbacks(name) Instance Protected methods

force_ssl

force_ssl(options = {}) Instance Public methods Force the request to this particular controller or specified actions to be under HTTPS protocol. If you need to disable this for any reason (e.g. development) then you can use an :if or :unless condition. class AccountsController < ApplicationController force_ssl if: :ssl_configured? def ssl_configured? !Rails.env.development? end end URL Options You can pass any of the following options to affect the redirect url host

quoted_table_name

quoted_table_name() Instance Public methods Returns a quoted version of the table name, used to construct SQL statements.

has_and_belongs_to_many

has_and_belongs_to_many(name, scope = nil, options = {}, &extension) Instance Public methods Specifies a many-to-many relationship with another class. This associates two classes via an intermediate join table. Unless the join table is explicitly specified as an option, it is guessed using the lexical order of the class names. So a join between Developer and Project will give the default join table name of âdevelopers_projectsâ because âDâ precedes âPâ alphabetically. Note that

decompose

decompose() Instance Public methods Performs canonical decomposition on all the characters. 'é'.length # => 2 'é'.mb_chars.decompose.to_s.length # => 3

cleanup

cleanup(options = nil) Instance Public methods

assert_emails

assert_emails(number) Instance Public methods Asserts that the number of emails sent matches the given number. def test_emails assert_emails 0 ContactMailer.welcome.deliver assert_emails 1 ContactMailer.welcome.deliver assert_emails 2 end If a block is passed, that block should cause the specified number of emails to be sent. def test_emails_again assert_emails 1 do ContactMailer.welcome.deliver end assert_emails 2 do ContactMailer.welcome.deliver Cont

test_quote_fixnum

test_quote_fixnum() Instance Public methods