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.



126
127
128
129
130
131
# File 'lib/i18n_routing_rails2.rb', line 126

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



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

alias_method :mkd_initialize, :initialize

#nesting_name_prefixObject



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

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

#nesting_path_prefixObject



137
138
139
# File 'lib/i18n_routing_rails2.rb', line 137

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