Displaying 20 results from an estimated 8000 matches similar to: "Routing: Language as first part of path, for just about everything"
2007 Dec 02
5
walkthrough: Rails 2.0 startup process
I haven’t found a complete big-picture walkthrough for the Rails
startup process when I looked for one recently.
There are some really useful resources about this but they are for
Rails 1.2 and each of them only covers certain parts of the process.
Thus, I’ve taken some notes while reading to the Rails code and
compiled the following guide from them.
2007 Feb 07
3
Upgrade to Rails 1.2.2 : RESTful routes not working anymore
Hello,
I just upgraded my app to Rails 1.2.2.
My routes are :
map.with_options :path_prefix => "/admin", :name_prefix => "admin_" do |m|
m.resources :requests, :controller => "admin/requests", :collection => {
:destroy => :delete, :search => :post } do |request|
request.resources :histories, :path_prefix =>
2007 Sep 06
3
routes, default_url_options and languages
Hello,
My app is available in 2 languages, English (en) and French (fr).
*I would like all my URLs to look like this :*
/fr/companies
/en/companies
*I''ve setup this route :*
map.connect '':lg/:controller/:action/:id''
I don''t want to specify the :lg parameter in every url_for calls.
The language remains the same unless the params[:change_lg] is set.
*In my
2011 Feb 05
1
ActionMailer::Base.default_url_options
Hi,
I want so set a default url for ActionMailer. I know,
ActionMailer::Base.default_url_options is deprecated, so I use
config.action_mailer.default_url_options = {
:host => "localhost"
}
in my environments (test.rb, production.rb, ...). The problem is, I get a
deprecation error and rails won''t start. I have no solution...
Any hints for me?
Testing started at
2010 Nov 10
1
rails "path_prefix" produces no correct verb route evaluation
Hi guys! ;)
If you set "routes.rb" as:
map.resources :pocoyo
You have RESTful rails routes facilites. Ok, let''s focus on these two
maps:
"http://domain.com/pocoyo" [GET] is mapped to "pocoyo" controller
and "index" action.
"http://domain.com/pocoyo" [POST] is mapped to "pocoyo" controller
and "create"
2007 Sep 18
2
Making attachment_fu polymorphic
I am working on a small model mixin called attachment_kung to make
attachment_fu polymorphic, so you no longer need a different table and
Model class for every associated attachment (Productimage, Ad_doc,
etc). All you really need is one model and table to handel all your
attachments - in some cases, anyway. I have the code working, but have
run into one small hitch that I can''t seem to
2007 Aug 17
0
map.with_options :path_prefix => ''
Hello,
I am getting a ''No route matches'' error in rspec with routes that have a
path_prefix composed by map.with_options. Rails recognizes the routes just
fine and the site works, but I can''t get the specs to pass unless I put the
prefix in each individual route. Any help is appreciated.
My foo model has a polymorphic owner which is what I want the path_prefix to
2007 Dec 12
0
default_url_options
Hi,
i recently added a def default_url_options to application.rb (used by
url_for , *_path etc). My method references request (eg
request.domain) . But when I spec a controller, its dies in
default_url_options with nil.domain, Is there a way for it to see
"request"?
I prefer to not have to stub it on every example.
linoj
2007 Nov 06
2
Recording just first part of call?
I know that I can record the contents of a call by calling Monitor()
or MixMonitor() from the dialplan just before invoking Dial().
I have a potential customer who wants only the first minute of each
call recorded (for identification purposes, without the storage overhead
of keeping the complete call).
Can anyone here think of the easiest way to do this? The only possibilities
I can think of
2008 Sep 02
3
Unable to set default_url_options[:host] for Action Mailer
I am attempting to provide ActionMailer with the request host needed to
generate a url.
Here is my code:
In config/environments/development.rb
config.action_mailer.default_url_options = { :host =>
"development_url.com" }
and in config/environments/production.rb
config.action_mailer.default_url_options = { :host =>
"production_url.com" }
When I run the above code
2009 Jul 30
4
attachment_fu + :path_prefix
Hello friends,
I have a query like I am using a attchment_fu to store images.
But the i don''t want to store to the default path let say :path_prefix =>
''public/uploads'' i want a dyname path for e.g :path_prefix => ''public/#{
current_user.id}'', So just wanted to know how can i say images to the
dynamic location.
Regards
Abhishek Shukla
2008 Jan 25
2
Routing optimization, named routes and default url options
I came across this when switching from rails 1.2.6 to 2.0.2, there is
a change in the way routes are generated between these to version due
to the routing optimization in rails 2.0.2.
In version 1.2.6 it was possible to overwrite the default_url_options
method in ActionController::Base to define parameters attached to each
generated url.
Due to the routing optimization in rails 2.0.2 this is not
2007 Dec 14
2
Rails 2.0 map.namespace and path_prefix
Hi!
I''m trying set up new routing in rails 2.0 and have 1 problem
map.namespace :admin do |admin|
admin.resources :permissions, :path_prefix => ''/:lang''
end
i want have addres like this:
http://site.com/en/admin/permissions
also i tested:
map.with_options :path_prefix => ''/:lang'' do |lang|
lang.namespace :admin do |admin|
2007 Feb 05
0
How do I use a RESTful helper with path_prefix?
Once upon a time I had this in my routes.rb:
map.client_home '':client/'', :controller => ''orders'', :action =>
''new''
All orders must be scoped within a client name, so this worked quite
well. I used a before_filter to scoop up the @client object by doing
a find_by_name.
Then I decided to expose the OrderController as a fully restful
2009 Jan 18
3
ActionMailer and url_for in helper methods
Hi,
I was wondering how to get url_for to work inside ActionMailer. I did
research on the web but I can''t seem to find something that fits what I
need.
In my application, each user can specify their custom domain to access
their. I have an ActionMailer that sends them notifications of changes
that occur. In there, I have a breadcrumbs helper method, which
generages something like:
2012 Oct 06
1
how to scope the /auth/:provider/callback , using OmniAuth for users and members
I have two separate groups of people authenticated w Devise , but in
this case I cannot used the Devise embedded OmniAuth support. So i am
using directly the OmniAuth gem.
Initialized w :
Rails.configuration.middleware.use OmniAuth::Builder do
..provider :twitter,
..
end
It''s running fine , but I have an issue with the callback route
mapping :
I tried
match
2006 Jan 16
1
default_url_options for relative tag URLs
Hello,
I need help with using ''default_url_options''. At least this is the
function that I *think* is involved in the solution I seek. :)
I''m deploying my rails app beneath an Apache ProxyPass setup. I''ve got
it all working fine except that any rails tagging functions in my
templates create absolute URL references.
For example, this stylesheet function in my
2006 Jul 24
0
Why doesn''t default_url_options :anchor => ... work for render
In my action, I test to see if a particular button was clicked, if it
was, I want the template to render, but to go to a particular anchor,
like #company.
E.g.
if params[''add_company'']
default_url_options :anchor => ''insurance''
end
#... logic
# then default render
In the add.rhtml:
<a name="company">
<%= text_field model, company_name
2008 Jun 12
3
Upgrading to 2.1 breaks my named routes
I just upgraded to 2.1 and attempted to log in to my application and
when this line is reached in my login action:
redirect_to(index_url)
I get the error
"wrong number of arguments (0 for 1)" [stack trace below].
Here''s my route:
map.index ''index'', :controller => ''e_simply'', :action => ''index''
I found
2007 Mar 15
2
simply_helpful's form_for not respecting default_url_options (only_path)
Looking over the discussions and Trac tickets am I correct in assuming
that the simply_helpful''s form_for not respecting the
default_url_options (specifically only_path) is a side-effect of some
other default behavior choices?
Personally, I set only_path to true as my default as I think except
were you are dealing with https it makes life much easier (especially
in testing) and is just