Module: RailsAssist::File::Routes

Included in:
Special, Special
Defined in:
lib/rails_assist/file/routes_file.rb

Instance Method Summary collapse

Instance Method Details

#insert_into_routes(route_stmt = nil, &block) ⇒ Object Also known as: insert_as_first_route_statement

insert as first route statement



4
5
6
7
# File 'lib/rails_assist/file/routes_file.rb', line 4

def insert_into_routes route_stmt=nil, &block
  statement = block ? yield : route_stmt
  routes_file.insert statement, :after => 'routes.draw do'
end

#insert_last_in_routes(route_stmt = nil, &block) ⇒ Object Also known as: insert_as_last_route_statement

insert as last route statement



11
12
13
14
# File 'lib/rails_assist/file/routes_file.rb', line 11

def insert_last_in_routes route_stmt=nil, &block
  statement = block ? yield : route_stmt
  routes_file.insert statement, :before_last => 'end'
end