[lnkForumImage]
TotalShareware - Download Free Software

Confronta i prezzi di migliaia di prodotti.
Asp Forum
 Home | Login | Register | Search 


 

Forums >

comp.lang.ruby

Re: Rails - MethodNotAllowed Error

Jayce Meade

3/10/2009 2:20:00 AM

Sorry, my last was a bit garbled. Here's a better one:

ActionController::Routing::Routes.draw do |map|

# Home controller
map.home '', :controller => "Home"
map.root :home

# Administration controller
map.admin 'admin', :controller => "Administration"
map.users 'admin', :controller => "Administration", :action => :users
map.edit_user 'admin', :controller => "Administration", :action =>
:edit_user
map.add_user 'admin', :controller => "Administration", :action => :add_user
map.remove_user 'admin', :controller => "Administration", :action =>
:remove_user
map.content_edit 'admin', :controller => "Administration", :action =>
:content_edit
map.options 'admin', :controller => "Administration", :action => :options
map.system_eval 'admin', :controller => "Administration", :action =>
:system_eval

# Account controller
map.logout 'logout', :controller => "Account", :action => "logout"
map.login 'login', :controller => "Account", :action => "login"

# About controller
map.about 'about', :controller => "About"
map.faq 'faq', :controller => "About", :action => "faq"
map.getinvolved 'getinvolved', :controller => "About", :action =>
"getinvolved"
map.showcase 'showcase', :controller => "About", :action => "showcase"

# Blog controller
map.blog 'blog', :controller => "Blog"

# Forum controller
map.forum 'forum', :controller => "Forum"

# Contact controller
map.contact 'contact', :controller => "Contact"
end

--------------------------------------------------
From: "Jayce Meade" <azimuth-rubytalk@live.com>
Sent: Monday, March 09, 2009 7:12 PM
To: "Ryan Davis" <ryand-ruby@zenspider.com>
Subject: Re: Rails - MethodNotAllowed Error

> Thanks. I've included my routes code below... I'm new to Rails, apologies
> if it's terrible. I want to be able to create routes only for the actions
> defined in the controllers... It looks impossible from what I've found
> without manually assigning each and every one.
>
> tionController::Routing::Routes.draw do |map|
>
> # Home controller
> map.home '', :controller => "Home"
> map.root :home
>
> # Administration controller
> map.admin 'admin', :controller => "Administration"
> map.users 'admin', :controller => "Administration", :action => :users
> map.edit_user 'admin', :controller => "Administration", :action =>
> :edit_user
> map.add_user 'admin', :controller => "Administration", :action =>
> :add_user
> map.remove_user 'admin', :controller => "Administration", :action =>
> :remove_user
> map.content_edit 'admin', :controller => "Administration", :action =>
> :content_edit
> map.options 'admin', :controller => "Administration", :action => :options
> map.system_eval 'admin', :controller => "Administration", :action =>
> :system_eval
>
> # Account controller
> map.logout 'logout', :controller => "Account", :action => "logout"
> map.login 'login', :controller => "Account", :action => "login"
>
> # About controller
> map.about 'about', :controller => "About"
> map.faq 'faq', :controller => "About", :action => "faq"
> map.getinvolved 'getinvolved', :controller => "About", :action =>
> "getinvolved"
> map.showcase 'showcase', :controller => "About", :action => "showcase"
>
> # Blog controller
> map.blog 'blog', :controller => "Blog"
>
> # Forum controller
> map.forum 'forum', :controller => "Forum"
>
> # Contact controller
> map.contact 'contact', :controller => "Contact"
> end
>
> Looking back at this, I'm not entirely sure why I used 'admin' for each on
> the administration controller, but I was also experimenting last night,
> and I'm afraid I lose my train of thought easily. Like I said, I want to
> be able to do something like
>
> http://www.mysite.com/admin/ed...
>
> which will run the editcontent action in the administration controller
> (defined by routes as admin, I want the full 'administration' as the
> controller class, though, if that makes sense).
>
> http://www.mysite.com/admin/sys...
>
> to run the system_eval action in the administration controller with
> params[:id] set to 0 so that I can identify the type of code being
> evaluated.
>
>
> Basically, I want as few possible entries in the routes.rb and as a
> result -only- getting the actions in the controller mapped out as routes
> for the program, nothing else, if that makes sense...
>
>
> Am I being an idiot?
>
> - Jayce
>
> --------------------------------------------------
> From: "Ryan Davis" <ryand-ruby@zenspider.com>
> Sent: Monday, March 09, 2009 6:14 PM
> To: "Jayce Meade" <azimuth-rubytalk@live.com>
> Subject: Re: Rails - MethodNotAllowed Error
>
>>
>> On Mar 9, 2009, at 17:43 , Jayce Meade wrote:
>>
>>> I'm sorry, I'm having issues subscribing to the Rails mailing list,
>>> so I'm hoping someone here will be able to help me. Below is an error I
>>> continuously get whilst using Rails, however I do not know the cause...
>>> The error description seems simple enough, but I have yet to identify
>>> what is actually causing it. Can anyone help me?
>>
>> A better use of your time at this point is figuring out how to get on
>> that list, rather than asking the question here.
>>
>>> ActionController::MethodNotAllowed
>>> Only get, head, post, put, and delete requests are allowed.RAILS_ROOT:
>>> /home/school/etc/rails_apps/main
>>>
>>> /usr/lib64/ruby/gems/1.8/gems/actionpack-2.1.1/lib/action_controller/
>>> routing/recognition_optimisation.rb:65:in `recognize_path'
>>> /usr/lib64/ruby/gems/1.8/gems/actionpack-2.1.1/lib/action_controller/
>>> routing/route_set.rb:384:in `recognize'
>>
>> I can't tell w/o any code or relevant backtrace, but I'd guess that
>> something in your routes.rb file is wrong. Binary elimination should
>> find it quick enough.
>>
>>


3 Answers

Gord Dibben

2/4/2010 5:24:00 PM

0

Set options in Excel for "ignore other applications.

Have your workbook open in an instance of Excel.

Then open your same named workbook from its folder by double-click......do
not go through File>Open.

You will start a new instance of Excel and open the same file in the new
instance but you will get the "locked for editing" message and can open in
"read only" mode.


Gord Dibben MS Excel MVP

On Wed, 3 Feb 2010 22:39:24 -0700, "Robert Crandal" <nobody@gmail.com>
wrote:

>I was hoping Excel had a "open doc in new instance" setting
>somewhere, because renaming the files temporarily will not
>work in my case or will be too inconvenient for users.
>
>
>"Tim Williams" <timjwilliams@comcast.net> wrote in message
>news:%23otbmRVpKHA.1548@TK2MSFTNGP06.phx.gbl...
>>
>> Rename one of them temporarily ?
>>
>> Tim
>>

Max

2/4/2010 6:41:00 PM

0

I was able to find an option called "Ignore other applications
that use Dynamic Data Exchange (DDE)". Was this the same
thing you mention below??

Also, I went ahead and set the above option, but when I
double on ANY macro enabled file I get an error message
that said something like "Excel cannot find the file".

BTW, I'm using Excel 2007


"Gord Dibben" <gorddibbATshawDOTca> wrote in message
news:a10mm5548onjsj9khhulu1la6bm1mfot17@4ax.com...
>
> Set options in Excel for "ignore other applications.
>
> Have your workbook open in an instance of Excel.
>
> Then open your same named workbook from its folder by double-click......do
> not go through File>Open.
>
> You will start a new instance of Excel and open the same file in the new
> instance but you will get the "locked for editing" message and can open in
> "read only" mode.
>
>

Gord Dibben

2/4/2010 11:45:00 PM

0

On Thu, 4 Feb 2010 11:40:45 -0700, "Robert Crandal" <nobody@gmail.com>
wrote:

>I was able to find an option called "Ignore other applications
>that use Dynamic Data Exchange (DDE)". Was this the same
>thing you mention below??

Yes

>
>Also, I went ahead and set the above option, but when I
>double on ANY macro enabled file I get an error message
>that said something like "Excel cannot find the file".

That's most likely because you have no double quotes around your command
line to start Excel.

"C:\yourpath\excel.exe"

I would suggest you re-register Excel 2007

Close Excel first and On the Windows Taskbar

Start>Run "excel.exe /regserver"(no quotes)>OK.

See the space between exe and /regserver

You might have to designate a full path to excel.exe.

In that case Start>Run "C:\yourpath\excel.exe" /regserver(quotes
required)>OK

After re-reg open Excel, go in and make sure the "ignore other etc." is
still checked.

I'm not sure why you want to open a bunch of read-only files in the first
place.


Gord

>
>BTW, I'm using Excel 2007
>
>
>"Gord Dibben" <gorddibbATshawDOTca> wrote in message
>news:a10mm5548onjsj9khhulu1la6bm1mfot17@4ax.com...
>>
>> Set options in Excel for "ignore other applications.
>>
>> Have your workbook open in an instance of Excel.
>>
>> Then open your same named workbook from its folder by double-click......do
>> not go through File>Open.
>>
>> You will start a new instance of Excel and open the same file in the new
>> instance but you will get the "locked for editing" message and can open in
>> "read only" mode.
>>
>>