Class: ActionController::Resources::Resource

Inherits:
Object
  • Object
show all
Defined in:
lib/i18n_routing_rails2.rb

Instance Method Summary collapse

Constructor Details

#initialize(entities, options) ⇒ Resource

Returns a new instance of Resource.



123
124
125
126
127
128
# File 'lib/i18n_routing_rails2.rb', line 123

def initialize(entities, options)
  @real_path = options.delete(:real_path)
  @real_path = @real_path.to_s.singularize if @real_path

  mkd_initialize(entities, options)
end

Instance Method Details

#mkd_initializeObject



122
# File 'lib/i18n_routing_rails2.rb', line 122

alias_method :mkd_initialize, :initialize

#nesting_name_prefixObject



130
131
132
# File 'lib/i18n_routing_rails2.rb', line 130

def nesting_name_prefix
  @real_path ? "#{shallow_name_prefix}#{@real_path}_" : "#{shallow_name_prefix}#{singular}_"
end

#nesting_path_prefixObject



134
135
136
# File 'lib/i18n_routing_rails2.rb', line 134

def nesting_path_prefix
  @nesting_path_prefix ||= (@real_path ? "#{shallow_path_prefix}/#{path_segment}/:#{@real_path}_id" : "#{shallow_path_prefix}/#{path_segment}/:#{singular}_id")
end