Displaying 20 results from an estimated 1000 matches similar to: "MethodNotAllowed"
2009 Sep 24
4
Action Controller ::MethodNotAllowed
Hi,
Iam getting the following error
ActionController::MethodNotAllowed
Only get, put and delete requests are allowed.
Actually, Iam trying to have multiple actions for a form to create
new record. The actions for the form are cancel, save, publish and
preview.
here''s the config/routes.rb file code snippet for the relevant
controller - Events
map.resources :events, :member =>
2009 Jul 01
1
form_for resources with :singular specified
I fully suspect that I''m missing the point here somewhere so I promise
I won''t be offended if you tell me I''m being daft.
My application rents equipment ... not equipments. So I have the
following:
map.resources :equipment, :singular => :equipment_instance
class Equipment < ActiveRecord::Base
class EquipmentController < ApplicationController
The
2008 Aug 01
1
rescue_from ActionController::MethodNotAllowed
Hello,
I''m having some trouble handing ActionController::MethodNotAllowed
errors. Basically, the following is defined in my controllers, but
obviously I''m missing something. Thanks in advance for any light you
can shed.
- - - - - - - - - - - - - - - - - - - -
class UsersController < ApplicationController
rescue_from ActionController::MethodNotAllowed, :with
=>
2008 Aug 25
0
ActionController::MethodNotAllowed
Hello All,
I m trying to use a form on my website to send an email. So my form
goes like this :
<% form_tag("/emailfeeder/create", :method => :post) do %>
<tr>
<td class="col1">To: </td>
<td class="col2"><%= text_field_tag "recepient",
@recepient.to_s, :disabled => true %></td>
2008 Jul 19
0
Why MethodNotAllowed all of a sudden?
I''m using shortcuts for login, logout etc. in routes.rb, for example:
map.login ''login'', :controller => ''session'', :action => ''new''
When I access http://localhost:3000/login I get following exception:
ActionController::MethodNotAllowed
Only get, head, post, put, and delete requests are allowed.
Does anyone know
2009 Nov 12
1
Please help me ------ Mapping an item to article
Hi everybody,
I have a form like this
<h1>New menuitem</h1>
<% form_for(@menuitem) do |f| %>
<%= f.error_messages %>
<p>
<%= f.label :title %><br />
<%= f.text_field :title %>
</p>
<p>
<%= f.label :alias %><br />
<%= f.text_field :alias %>
</p>
<p>
<%= f.label
2006 Jul 22
12
Community request - can someone show me REST?
I mentioned this in another thread, but I''ve got a formal request now.
After reading tons of stuff about REST, I don''t really get it. I
need to see an example.
I''d like someone to write up an example blog app with these requirements
- RESTful using the simply_restful plugin (or edge rails)
- allows posting of comments to articles
- has categories for posts
No need
2011 Dec 16
3
PROBLEN IN AJAX USING RJS
I am using rails 3. I have problem in out put so please tell me my
mistake
routes
-------
entermatch ''/view_article/:user_id/:article_id'' =>
''articles#view_article'', :as => :view_article
resources :users do
resources :articles do
resources :comments
end
end
article controller
------------------
def view_article
@user =
2007 May 09
1
How can I change a form's onsubmit event handler using rjs?
Hi all,
I have a ajax form creating by "form_remote_for", whose url is to
create a new model by default. The page doesn''t change after the ajax
call on submit button so the form is still there after the new model
is created. But if I submit the form for the second time, I want to
update the formerly created model using an Ajax post.
I think I could render an rjs at the end of
2007 Jul 19
3
Merb::Controller#url Usage
I have a question about the usage of Merb::Controller#url. When I
have nested resources, requesting the new action works differently
than I expected. I was wondering what the intended usage is.
For example:
Say I have
r.resources :articles do |article|
article.resources :article_attachments
end
irb(main):002:0> show_routes
[:articles, "/articles"]
[:article_attachments,
2006 Jul 07
5
link_to: link is missing id
I''m using a legacy table, where the unique id is not ''id''
I have a Model class like the following:
class Article < ActiveRecord::Base
set_primary_key "ARTICLE_ID"
end
however, using a link_to like the following (modified scaffolding),
the link has no id value:
<% for article in @articles %>
<tr>
<% for column in
2010 Mar 27
2
Shorter Rails 3 routes
Hi,
I have a small blog application, and I would like to shorten its routes.
Here they are:
Blog::Application.routes.draw do
resources :categories do
resources :articles do
resources :comments
end
end
A rake routes command produce the following lines:
GET
/categories/:category_id/articles/:article_id/comments(.:format)
2006 Feb 21
6
Select articles from group with id ''1'' and id ''2''
I have to tables: "articles" and "groups". Between I have
article_groups as a jointable. Now I want to select every article who
is a member of group with id ''1'' and id ''2''. Whats best way to get
that?
Extract from schemas:
CREATE TABLE articles (
id int auto_increment,
ingress text NOT NULL,
story_text longtext,
constraint fk_items_users
2010 Sep 11
10
Having difficulty with threaded comments, using acts_as_tree
I''ve been having problems making threaded comments for the last few
days. Mainly with creating children and displaying the children.
Currently, I have comments shown at the bottom of my articles show view.
The top level comments work, but I do not really know how to implement a
way for users to "reply" to the top level comments and take them to a
form (the comment
2008 Jan 11
3
Date range queries return zero results
Hello,
I am having trouble getting data ranges to work correctly. I am using
the following command to load the db:
index << {:title => row[7].to_i,
:date => Date.strptime(row[3], ''%Y-%m-%d''),
:page_id => row[5].to_i,
:page => row[6].to_i,
:content_type => row[1].to_i,
2009 May 02
10
Problem verifying routing error
Hi,
When upgrading to rspec/rspec-rails 1.2.6 gem (from 1.1.12), I''m having
a new problem verifying routes that should not exist.
This is to support something like this in routes.rb:
map.resources :orders do |orders|
orders.resources :items, :except => [:index,:show]
end
I used to use lambda {}.should_raise( routing error ), but it stopped
detecting any raised error.
2006 Jan 09
4
Problem with habtm and resulting SQL insert
Cheers,
I have a problem with 1.0 and a habtm relationship between User and Article.
I want to save all articles that users read. I have these models:
class User < ActiveRecord::Base
has_and_belongs_to_many :read_articles, :class_name => "Article",
:join_table => "read_articles"
...
end
class Article < ActiveRecord::Base
has_and_belongs_to_many :readers,
2007 Aug 13
1
SqueezeBox, a new Mongrel handler
SqueezeBox is a simple file system based routing framework for erubis
templates.
It aims for a couple of niceties as well:
Instead of putting your logic inside your template, like you would
with PHP, SqueezeBox recognizes a separate logic file to be called
before it loads the template. This allows you room to load
ActiveRecord models or do calculations. These logic files return to
the webserver
2009 Feb 10
2
rescue_from for NoMethodError
Hi everyone,
I was just trying to catch some exceptions in my app,
for "Record Not Found" I used this
in my application.rb file
rescue_from ActiveRecord::RecordNotFound, :with => :record_not_found
rescue_from ActionController::NoMethodError, :with => :show_error
private
def record_not_found
render :text => "404 Not Found", :status =>
2009 Jul 17
1
attachment_fu :partition => lamda {}
Hi -
I am trying to dynamically create my partition folders via
attachment_fu. I have read about a hack that allows you to do this on
the attachment model:
:partition => lambda {|a| a.article_id}
Which passes the model''s object into the lambda and uses the
''article_id'' attribute as its directory name. However, this isn''t
work for me. I think the lambda