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
| def content_tag(*args) | |
| if block_given? | |
| tag = Tag.new(args[0]) | |
| old_buf = @output_buffer | |
| @output_buffer = ActionView::OutputBuffer.new | |
| yield(tag) | |
| content = tag.render(@output_buffer) | |
| @output_buffer = old_buf | |
| content | |
| else |
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
| <%= content_tag :div do |div| %> | |
| It's a | |
| <% div.css << 'test' %> | |
| div | |
| <% end %> | |
| <%= content_tag :div do |div| %> | |
| <% div.css << :boo %> | |
| Embedded tag awesomeness! | |
| <%= content_tag :p do |p| %> |
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
| <%= content_tag :div do |div| %> | |
| <% div.css << 'test' %> | |
| <%= content_tag :h2 do |h| %> | |
| <% h.css << :boo %> | |
| Hi! | |
| <% end %> | |
| <% end %> |
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
| Everytime a HTML tag has the [as=*] attribute, Shiny will instantiate a Javascript object on the fly. It's not instantiate until it reaches the main Document. So you can manipulate it off screen and the object will only be created once it's appended to the document. | |
| No need to check for document ready or page:load(turbolinks), everything is instantiated as soon as a valid DOM is found. |
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
| /Users/pothibo/Develop/ecrire/lib/ecrire/app/models/label.rb:9: syntax error, unexpected '\n', expecting => | |
| from /usr/local/var/rbenv/versions/2.0.0-p353/lib/ruby/gems/2.0.0/gems/activesupport-4.1.1/lib/active_support/dependencies.rb:443:in `load' | |
| from /usr/local/var/rbenv/versions/2.0.0-p353/lib/ruby/gems/2.0.0/gems/activesupport-4.1.1/lib/active_support/dependencies.rb:443:in `block in load_file' | |
| from /usr/local/var/rbenv/versions/2.0.0-p353/lib/ruby/gems/2.0.0/gems/activesupport-4.1.1/lib/active_support/dependencies.rb:633:in `new_constants_in' | |
| from /usr/local/var/rbenv/versions/2.0.0-p353/lib/ruby/gems/2.0.0/gems/activesupport-4.1.1/lib/active_support/dependencies.rb:442:in `load_file' | |
| from /usr/local/var/rbenv/versions/2.0.0-p353/lib/ruby/gems/2.0.0/gems/activesupport-4.1.1/lib/active_support/dependencies.rb:342:in `require_or_load' | |
| from /usr/local/var/rbenv/versions/2.0.0-p353/lib/ruby/gems/2.0.0/gems/activesupport-4.1.1/lib/active_support/dependencies.rb:480:in `load_missing_constant' | |
| from /usr/ |
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
| ip_address_whitelist: | |
| - 127.0.0.1 | |
| - 1.2.3.4 | |
| - 5.6.7.8 | |
| whitelisted_pages: | |
| - /assets/.* | |
| - / | |
| - /login |
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
| module MyProject | |
| class Application < Rails::Application | |
| initializer 'configure devise' do |app| | |
| app.config.devise.somethin = 'blabla' | |
| end | |
| end | |
| end |
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
| class MyController < ApplicationController | |
| def create | |
| params_array_not_supported.each do |offer| # KABOOOM! | |
| ... | |
| end | |
| offers_params_not_chanaible_with_array.each do |offer_param| | |
| Offer.new offer_param # ActiveModel::ForbiddenAttributes |
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
| module YouApp | |
| class Applcication < Rails::Application | |
| end | |
| end |
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
| class ThingsController | |
| def create | |
| @thing = Thing.new(thing_params) | |
| thing.creator = current_user | |
| thing.save! | |
| Stats.count("Thing Created", 1) | |
| Thing.delay.send_notifications(thing.id) | |
| end | |
| def update |