Displaying 20 results from an estimated 10000 matches similar to: "Two buttons respond do same action.??"
2011 May 27
3
unable to start server
When i start the server "rails s",following error message appears:
=> Booting WEBrick
=> Rails 3.0.7 application starting in development on http://0.0.0.0:3000
=> Call with -d to detach
=> Ctrl-C to shutdown server
Exiting
/usr/lib/ruby/gems/1.8/gems/actionpack-3.0.7/lib/action_dispatch/routing/mapper.rb:167:in
`default_controller_and_action'': missing :controller
2008 Mar 07
2
Trouble using RESTful helper
Hi,
I am trying to get into this REST thing, I have a nested resource
whith the following route:
ActionController::Routing::Routes.draw do |map|
map.resources :members
map.resources :clubs do |club|
club.resources :members
end
map.connect '':controller/:action/:id''
map.connect '':controller/:action/:id.:format''
end
Everything worked ok for this
2010 Jun 21
4
Unknown action No action responded to 2. Actions: show
I''m trying to create a simple RoR application that shows me the records
inside my table, provided that it is an example I''m working on the "Head
First Rails" book.
When I try to retrieve the record I get the following message:
"Unknown action
No action responded to 2. Actions: show"
Why am I having that? And, how can I fix this issue?
Provided that:
1- I
2006 Jan 20
1
form_tag and multiple buttons inside problem
Hi, I have a bit of a problem with a form in rails. Well, the problem really is
me not fully understanding the mechanism of the form_tag, so here''s what i try
to do:
The idea is to present a some edit fields for some @product attributes and then
present a table showing the @product.pieces (pieces for every @product) and to
include a "Edit Piece" and "Delete Piece"
2007 Dec 28
1
Rake routes & console showing one thing, app doing another
OK, I have a routing problem, that seems to be working in the console,
and with rake routes but not in the app.
I have people that have nested tasks, like so:
-------------------------------
# routes.rb
map.resources :people do |person|
person.resources :phone_notes
person.resources :documents
person.resources :tasks, :member => {:complete => :put}
end
map.resources :tasks, :member
2009 Feb 13
0
THREE MODELS PROBLEM IN 'NEW' ACTION
Hello,
I have this problem :
When I use three models, and associate them, then, my ''new'' action need more data to work, How can I resolv it, or I do it in the right way ?
Thanks
Jose.
******************** my models *************************
class Libro < ActiveRecord::Base
has_many :lecciones
end
class Leccion < ActiveRecord::Base
has_many :vocabularios
2007 Dec 28
1
Getting wrong route - fairly complete error description
OK, I have a routing problem, that seems to be working in the console,
but not in the app.
I have people that have nested tasks, like so:
-------------------------------
# routes.rb
map.resources :people do |person|
person.resources :phone_notes
person.resources :documents
person.resources :tasks, :member => {:complete => :put}
end
map.resources :tasks, :member => {:complete =>
2011 Apr 30
8
"uninitialized constant PostsController::Post"
This time i read scaffold tutorial very carefully and finally try to
generate a form without using the scaffold(just used a controller and
view ).what i have done till now ,is as follow.Using rails 3.0.7.
"rails generate controller posts
index"
1) post_controller.rb
class PostsController < ApplicationController
def index
@post=Post.new
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 =>
2005 Aug 28
8
Save and delete buttons: POST vs. proximity dilemma
I''m in a dilemma: In order to keep GET requests from deleting objects,
I''d like to use the button_to helper to get "something" that generates
a POST request. Unfortunately, that something is a form and forms can''t
be nested.
I''d also like to place buttons related to the same form close to each
other. At the top are some navigational buttons
2009 Aug 07
4
ActionController::UnknownAction (No action responded to 22.
I try to switch my application from Rails 2.2.2 to Rails 2.3.3.
In namespace :admin I have a resource-based controller. See controller
class Admin::OSystemsController < Admin::BaseController
def index
.......
end
def edit
.........
end
def update
..........
end
end
Resource is added to routes.rb like
map.namespace :admin do |admin|
............
admin.resources :o_systems,
2010 Jul 06
4
how to make confirm boxes conditional?
Hi,
I''d like to make the :confirm option in my link_to/button_to erb
elements conditional. So, if the page is in some state, no
confirmation is requested, but not otherwise, etc.
So far, my only (ugly) approach is to replace the linker html itself
depending on changes in state, but I believe there must be an easier
way to ''toggle'' the confirmation option on/off.
Can
2014 May 16
0
(Beginner) ActionController::UrlGenerationError - No route matches
(Using Rails 4.1.1 with Ruby 2.1.1 on Mac OSX 10.6 Snow Leopard)
I'm doing a Rails tutorial (in case you are interested in: It's
http://guides.rubyonrails.org/getting_started.html), and I'm stuck on
the following:
I create in some erb file a link using
<%= link_to 'Add new weird stuff', controller: new_article_path %>
and this raises the exception
2012 Sep 16
1
“Routing Error No route matches {}” when omniauth failed on registration
(Original question was asked here:
http://stackoverflow.com/questions/11506734/routing-error-no-route-matches-when-omniauth-failed-on-registration
)
I am using omniauth-identity and configure its "fail on registration".
My files:
config/initializers/omniauth.rb
OmniAuth.config.logger = Rails.logger
Rails.application.config.middleware.use OmniAuth::Builder do
#...
provider
2007 Nov 02
1
Some proposed changes
I''ve got some changes queued up that I want to run by everyone before
I commit.
First, I''ve added a filter that sets the :format variable to "fbml"
when you are in the canvas view. That means with edge rails you can
use index.fbml.erb for facebook and index.html.erb for non facebook
requests and the right thing will happen. This is important for doing
things
2012 Feb 11
1
rake command shows the error
rails -v=2.3.8
gem -v= 1.4.2
ruby -v=1.8.7
When i issue the "rake" command ,it gives the following error .
(in /home/amrit/amrit/OSV/OpenStreetView)
/usr/bin/ruby1.8 -I"lib:test"
"/usr/lib/ruby/gems/1.8/gems/rake-0.8.7/lib/rake/rake_test_loader.rb"
"test/functional/main_controller_test.rb"
"test/functional/upload_controller_test.rb"
2011 Apr 25
30
NoMethodError in Book
I got a following error.
NoMethodError in Book#new
Showing /home/amrit/boook/app/views/book/_form.html.erb where line #1
raised:
undefined method `model_name'' for NilClass:Class
The content of _form.html.erb file are:
<%= form_for(@post) do |f| %>
<% if @post.errors.any? %>
<div id="error_explanation">
<h2><%=
2011 May 19
0
Unable to find the image path via file system using the paperclip plugin through the get method
Hello all,
with great difficulty , I guess I have finally been able to find the
appropriate git commit of paperclip which would suit my project''s config
which is Ruby 1.8.7 and rails 2.0.2.
I am trying to implement a POC before I integrate paperclip in my
project. The POC is basically implementing each post with an appropriate
image beside it. It seems to pretty much work, its just
2006 Aug 18
4
Button on view
Hi,
I have a page containing 3 views (2 are partials). One of the partials
needs to have a button that will clear a table called "messages" in the
database.
I can put a button like this "<%= button_to "Clear Messages", :action =>
''clear_messages'' %>" and have the controller do "Message.delete_all".
But the problem is that the
2005 Nov 22
3
Idiom for submit button?
What is the rails idiom for submit buttons on forms?
All other field types have helpers, but button_to creates its
own form, so should not be used. I''ve looked in "Agile Web Dev. with
Rails" but can''t see what I should do instead.
Is this "difficult" because it runs counter to AJAX type forms?
And, related, is there a way to ensure that hitting return in