module ActionController
module UrlFor
extend ActiveSupport::Concern
include AbstractController::UrlFor
I have read the rails source.In the actionpack/lib/action_controller/
metal/url_for.rb
def url_options
@_url_options ||= super.reverse_merge(
:host => request.host,
:port => request.optional_port,
:protocol => request.protocol,
:_path_segments => request.symbolized_path_parameters
).freeze
if _routes.equal?(env["action_dispatch.routes"])
@_url_options.dup.tap do |options|
options[:script_name] = request.script_name.dup
options.freeze
end
else
@_url_options
end
end
end
end
I don''t know where define the script_name.I execute the below command
apple@apple:~/rails$ grep --exclude-dir test -r script_name *
actionpack/lib/action_controller/metal/url_for.rb:
options[:script_name] = request.script_name.dup
actionpack/lib/action_dispatch/routing/
route_set.rb: :trailing_slash, :anchor, :params,
:only_path, :script_name]
actionpack/lib/action_dispatch/routing/route_set.rb:
script_name = options.delete(:script_name)
actionpack/lib/action_dispatch/routing/route_set.rb: path
(script_name.blank? ? _generate_prefix(options) :
script_name.chomp(''/'')).to_s
railties/lib/rails/commands/plugin.rb:
attr_reader :environment, :script_name
railties/lib/rails/commands/plugin.rb: @script_name File.basename($0)
railties/lib/rails/commands/plugin.rb: o.separator "
#{@script_name} plugin install http://example.com/my_svn_plugin\n"
railties/lib/rails/commands/plugin.rb: o.separator "
#{@script_name} plugin install
git://github.com/SomeGuy/my_awesome_plugin.git\n"
railties/lib/rails/commands/plugin.rb: o.separator "
#{@script_name} plugin install -x my_svn_plugin\n"
railties/lib/rails/commands/plugin.rb: o.banner = "Usage:
#{@base_command.script_name} install PLUGIN [PLUGIN [PLUGIN] ...]"
railties/lib/rails/commands/plugin.rb: o.banner = "Usage:
#{@base_command.script_name} remove name [name]..."
railties/lib/rails/commands/plugin.rb: o.banner = "Usage:
#{@base_command.script_name} info name [name]..."
railties/lib/rails/commands/runner.rb: script_name File.basename($0)
apple@apple:~/rails$
what mean the script_name?where define the script_name?
--
You received this message because you are subscribed to the Google Groups
"Ruby on Rails: Talk" group.
To post to this group, send email to
rubyonrails-talk-/JYPxA39Uh5TLH3MbocFF+G/Ez6ZCGd0@public.gmane.org
To unsubscribe from this group, send email to
rubyonrails-talk+unsubscribe-/JYPxA39Uh5TLH3MbocFF+G/Ez6ZCGd0@public.gmane.org
For more options, visit this group at
http://groups.google.com/group/rubyonrails-talk?hl=en.