Displaying 20 results from an estimated 1000 matches similar to: "Routing Priority and Unknown Action"
2006 Mar 23
10
Domain Requirements in Routes (Edge Rails)
I saw on the bottom of the following page that you can route requests to
different controllers based upon which subdomain is being requested.
http://wiki.rubyonrails.com/rails/pages/Routes
with_options :requirements=>{:subdomain=>''first.com''} do
map.connect '''', :controller => "first/catalog"
map.connect ''featured'',
2009 Dec 06
9
Route error to Admin namespace
Hi.
I have some apps that i have "admin" areas to the clients manager the app.
This "admin" is a directory on my controllers path, like this:
my_site
--> app
-->-->controllers
-->-->-->admin
And my controllers in "admin", i use the correct namespace(example for
clients_controller):
class Admin::ClientsController < AdminController
Only doing
2006 Apr 22
3
how do I manually throw a 404?
I''m sure this has been asked before but a quick search on the web didn''t
give me any hints..
I''d like to do this:
@person = Person.find_by_name
throw_page_not_found unless @person
Anybody know how to do this, do I have to manually tinker with the
response object?
--
Posted via http://www.ruby-forum.com/.
2007 May 17
2
Scoped options setting?
Is there any way to set options during the evaluation of a particular
expression, with them automatically reset when control leaves that
expression, however that happens? Kind of like "let" on a "special"
variable does in Lisp. I naively tried
with(options(warn=-1), {
fit <- fitdistr(data, 'weibull') # complains about NaNs
})
but this leaves
2006 Jul 28
11
Forum
Im making forum and i have problem with paths.
Here is code:
http://pastie.caboo.se/6389
With this code, it works. But its a bit weird to use so many paths
function. For every path i need to make new function. So can you suggest
me something.
Tables are like here:
http://wiki.rubyonrails.com/rails/pages/ForumExample
--
Posted via http://www.ruby-forum.com/.
2006 May 24
2
named routes confusion
Hi,
I''m trying generate a URL from a named route like: namedroute_url(params...)
but the generated route is always coming out as the first match from the routes table.
The named route is defined inside a map.with_options block, but that shouldn''t matter should it?
dorian
--
--
I do things for love or money
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|
2010 Oct 01
1
I18n.with_options bloc executed TWICE
Hi, to avoid putting the whole locale scope on every I18n.t call I''m
trying to use a scope, as stated in the doc
(http://guides.rubyonrails.org/active_support_core_extensions.html#with_options)
I tried with
<%= I18n.with_options :locale => :en, :scope => ''portal.visitor_menu'' do
|i18n|%>
Try <%= i18n.t :fav_songs %>
<% end %>
But it produce
2006 Mar 22
1
undefined method `respond_to'' when using Exception Notifier Plugin
I''m trying to use the exception notifier plugin and I''m getting this error
message:
NoMethodError (undefined method `respond_to'' for
#<Adm::PeriodController:0xb74c9804>):
/vendor/plugins/exception_notification/lib/exception_notifiable.rb:64:in
`render_500''
/vendor/plugins/exception_notification/lib/exception_notifiable.rb:76:in
2011 Jan 19
6
rake aborted! can't convert Hash into String
Hello,
I encouter a problem when i try to do "rake db:migrate":
rake aborted!
can''t convert Hash into String
Here is the trace result:
** Invoke db:migrate (first_time)
** Invoke environment (first_time)
** Execute environment
rake aborted!
can''t convert Hash into String
/System/Library/Frameworks/Ruby.framework/Versions/1.8/usr/lib/ruby/1.8/fileutils.rb:1408:in
2006 Apr 04
1
subdomain routing
According to the wiki (http://wiki.rubyonrails.org/rails/pages/Routes)
you can handle subdomain routing in routes.rb. Like this:
with_options :requirements=>{:subdomain=>''first.com''} do
map.connect '''', :controller => "first/catalog"
map.connect ''featured'', :controller => "first/catalog",
2007 Jan 16
4
Subdomain Account Keys Best Practice
Hi all,
I''m thinking of useing sub-domains as account keys, something I''ve played
with previously.
I have accounts and users, fairly standard, except that users can belong to
many accounts, and accounts can have many users.
So I figure I need to have an area on the main domain, that allows users to
view their account memberships and things. Sort of like a dashboard for
each
2009 Dec 07
1
routing requirements quick question
Hi everyone, first e-mail here :)
I have the following in my routes.rb file.
map.connect ''posts/index/:page'',
:controller => ''posts'',
:action => ''index'',
:requirements => {:page => /\d+/ },
:page => nil
end
Does :requirements => {:page => /\d+/ } mean that if the :page
2007 Sep 04
11
returning(...) ?
The following construct is an ActiveSupport-ism:
returning(Foo.new) do |foo|
...
end
I don''t especially like it, since it''s both more verbose and less efficient
than the direct alternative:
foo = Foo.new
...
foo
It doesn''t occur many times in Merb, so does anyone agree with me that it
should be removed?
I tried doing this (patch attached) and I find
2007 May 21
2
Rails'' fixtures suck! But what about something like this?
Sorry about the very long email, but this is a hairy topic that''s been
annoying me for some time and I decided to try to do something about.
Also, if you got this twice, I apologize too, but it didn''t seem to
have successfully gone out the first time.
Background:
----------
I''ve been dealing with Rails for about a year and a half now. I''ve
been using
2006 Jul 05
2
Serialized object behaves weird
Hi!
I got a class named EinsatzFilter which I serialized to session. Before
saving to session it works afterwards I keep getting the message:
"undefined method `to_s'' for #<Person:0x38c6ab8>". "Person" is a from
ActiveRecord::Base inherited class.
Code:
class EinsatzFilter
include ApplicationHelper
attr_reader :personen, :monat, :projekte, :kunde
2009 Mar 31
3
serving xml
Hi All,
I''m trying to serve some XML from my Rails 2.0 server.
I have a Flash file that always reads its configuration from
/home/gallery.xml
So, I would like to build the contents from the database and serve it
back to the flash file when it hits my xml url.
If it was HTML that it was asking for then in my home controller I have
a gallery method that serves back a gallery.html.erb
2008 Jan 16
5
named route new_session not working
Anyone have any idea why a named route would NOT work? I did rake
routes to make sure it was there and it was but for some reason
new_session doesn''t work.
--
Posted via http://www.ruby-forum.com/.
--~--~---------~--~----~------------~-------~--~----~
You received this message because you are subscribed to the Google Groups "Ruby on Rails: Talk" group.
To post to this group,
2007 May 24
3
Exception Notification Plugin Question
Hi,
I have two questions re the Exception Notifier plugin (i.e. which you
install via "ruby script/plugin install exception_notification")
Q1 - In it''s current setup (where it uses /public/500.html) is it possible
to remove the "Status: 500 Internal Server Error Content-Type: text/html"
text which seems to mysteriously get place at the top of the page?
Q2 -
2006 Jun 30
6
RSS::Parser Documentation
Hi
I am trying to use the RSS classes from "rss/2.0" and everything works
but I want to know what attributes and properties I can get at from each
of the classes I am getting back.
For example, the class has a "channel" which I can tell has a "title"
attribute (because it works when I query it :) but I would really like a
list of every attribute that is