...you under most circumstances. Basics When ActionController picks up a flash object, it will call the #sweep method once; that method checks the list of used flash entries and deletes...
...def_delegator :topic, :title, :subject end Looks a lot like the above def_delegators call but behaves differently. Rails does not provide a pretty solution to this, but simply write...
...time you start the VNC server. It will not be used by the above call after that (due to SecurityTypes None). So for a first-time setup run it without...
...event.currentTarget still refers to the . If you wanted to get document, you need to call event.delegateTarget. Rule of thumb Use event.currentTarget. When binding event callbacks, you usually want to do...
end If you want to save the graph as image (format is .png), call write('path/to/filename.png') on a graph. For displaying the graph in a view of you own...
...accessible in define_method. self is the "current object" and implicit receiver of method calls: in a method body, self is the receiver of the method
...cucumber_factory. Marking step definitions as overridable To mark a step definition as overridable, call #overridable on the definition object: Given /^there is a movie with a (.*?) tone$/ do ... end.overridable...
...and (in old Clearances) remember me functionality works. Login Clearance defines a database column called "remember_token". When you login in, that token will be saved in a cookie. For...
...value (be aware that you should use a secure and salted hash) or better call the the_user_to_log_out.reset_remember_token! method that does the things for you. Note: Have a look...
...barby/outputter/png_outputter) Pro tips Barby's PNG outputter uses ChunkyPNG under the hood. You can call to_image to receive a ChunkyPNG::Canvas that you can rotate, resample, or just convert...
...Rails < 4.1 and want it to replace #to_json (but you can always just call Oj.dump explicitely). Security warning: Oj does not escape HTML entities in JSON
...check with a type rake just to be sure. Yaaaay. No more clumsy rake calls...
...are already set will not be overwritten when defined again. Thus, put your inherit calls after all other attribute definitions inside a blueprint...
...the attached script. To use it, you first need to wrap the require 'mathn' call (usually by wrapping Bundler.require) like this: # config/application.rb MathnWorkaround.intercept do Bundler.require(:default, Rails.env) if defined?(Bundler...
...X forwarding, when connecting to the remote machine, and add -X to the ssh call. Now, when you start a program with a UI (e.g. virtualbox) in that SSH session...
xml = Nokogiri::XML(" foo bar ") parses an xml string. You can also call Nokogiri::HTML to be more liberal about accepting invalid XML. xml / 'list item' returns all...
...is some code to allow using unobtrusive JavaScript on pages fetched with an AJAX call. After you included it, you now do not use the usual $(function() { $('.some_tag').activateStuff...
...to elements nested below $(this) Normal pages work as before (your $.unobtrusive functions are called automatically), but you gain the option to manually run those by calling $(newContent).activateUnobtrusiveJavascript();
Dir[Rails.root.join("spec/controllers/shared_examples/**/*.rb")].each {|f| require f} Make sure you don't call your examples files like ..._spec.rb, else RSpec will believe they're actual spec files and...
...them into their corresponding CSS files inside public/stylesheets. When your project uses Lemonade just call: compass watch When using the latter you do not need to sass --watch explicitly as...
...register the host in /etc/hosts or just connect to http://localhost/ restart Apache or call touch tmp/restart.txt in your project root SSL link /etc/apache2/mods-available/ssl.load and /etc/apache2/mods-available/ssl.conf into /etc/apache2/mods-enabled using sudo...
...via Spring preloader in process 14679 Loading development environment (Rails 5.2.2.1) Traceback (most recent call last): .../lib/ruby/gems/2.6.0/gems/spring-2.1.0/lib/spring/application.rb:175:in 'fork': No such file to load -- irb/encoding_aliases.rb (LoadError) .../lib/ruby/gems/2.6.0/gems/spring-2.1.0/lib/spring/application.rb:175:in...
...reject!' for nil:NilClass (NoMethodError) The solution is to upgrade the gem binding_of_caller to version 0.8.0. Found that solution here...
...same id attributes for fields again. This card presents you with a way to call something like - form_for @user, :prefix => 'overlay' do |form| = form.text_field :email
We usually put these constants in a Pattern class, so we can call them like Pattern::EMAIL...
...make the warning go away. Make sure to put it above all other config.i18n calls, or the warning might not disappear. config.i18n.enforce_available_locales = false If the warning still sticks...
...test, you can disable this behavior for pending features only. To make any pending call reconfigure the current cassette, you can simply redefine it. There is no official API to...