class RuboCop::Cop::GitHub::RailsControllerRenderActionSymbol

Constants

MSG

Public Instance Methods

autocorrect(node) click to toggle source
# File lib/rubocop/cop/github/rails_controller_render_action_symbol.rb, line 35
def autocorrect(node)
  lambda do |corrector|
    corrector.replace(node.source_range, "\"#{node.children[0]}\"")
  end
end
on_send(node) click to toggle source
# File lib/rubocop/cop/github/rails_controller_render_action_symbol.rb, line 23
def on_send(node)
  if sym_node = render_sym?(node)
    add_offense(sym_node, location: :expression)
  elsif option_pairs = render_with_options?(node)
    option_pairs.each do |pair|
      if sym_node = action_key?(pair)
        add_offense(sym_node, location: :expression)
      end
    end
  end
end