Displaying 20 results from an estimated 8000 matches similar to: "Controller/action not working in url"
2009 Oct 28
2
mislav-will_paginate(will_paginate)
mislav-will_paginate(will_paginate) doesn''t work after search.
servers_controller.rb
def index
@servers = Server.paginate(:page => params[:page], :per_page => 20,
:order => ''device_id ASC'')
respond_to do |format|
format.html # index.html.erb
format.xml { render :xml => @servers }
end
end
def search
@servers =
2008 Oct 03
1
fragment caching with search box
I''m trying to setup some fragment caching which works fine for the index
but i''m not sure how to ignore the caching if they are searching the
index results.
my code in short:
ItemsController
def index
@items = Item.search(params[:search], params[:min_rank],
params[:max_rank], params[:classification_id], ...)
end
index.html.erb
<% cache (''items'',
2005 Mar 07
2
Problem with Rails 0.10.1
I''ve got a view template that contains this:
<%= render_component(:controller => ''reviews'',
:action => ''show'',
:params => { ''id'' => review.id })
%>
In Rails 0.10.0 this worked just fine. After I upgraded to 0.10.1 I get this
error:
ActiveRecord::RecordNotFound in
2010 Sep 03
1
Action Controller Error: undefined local variable or method `current_user'
Newbie learning Rails. I''m currently on Chp9 here:
http://railstutorial.org/chapters/sign-in-sign-out#top
At the end of the tutorial, rails is erroring (see below). being new
to Rails and after having checked the tutorial... How do you resolve
this kind of error. It''s saying current_user is not defined, and it is
supposed to be defined with/Sites/sample_app/app/helpers/
2006 Aug 24
2
Design questions on creating digg.com-like URLs (are they considered RESTful?)
Hi everyone, I''m working on creating a site that functions similar to
digg.com (please no "no more digg clones" remarks please! :) ). One
thing I really like about digg is there URLs are very nice to read and I
would like to emulate that without having a lot of actions spread out
all over my application.
So in my app I have three main resources:
Users, Tags, and Items
2011 Jul 14
0
subclasses with inherited_resources?
I''m trying out inherited_resources and so far so good. However, one
problem I''ve run into is that it''s very difficult to customize
inherited_resource behaviour in subclasses. Looking through the
source I see it uses things like undef_method and class_attribute.
For example, if I have the following controllers:
class ItemsController
inherit_resources
actions :new,
2012 Mar 06
0
Devise/Cancan Signout User On Controller Action
I have implemented Devise for Authentication and Authorization in ROR
application everything seems fine but getting one issue. I have two
modals "Account" and "Transactiona" , and so two controllers
respectively.
My Transaction Index view call one of Account Controller method like
this
2007 Jan 20
1
Missing action error not being caught
I keep getting a blank page containing only the following:
"There was a controller specfic error processing your request."
Though I have the following in my application.rb
def rescue_action_in_public(exception)
case exception
when UnknownAction, ActiveRecord::RecordNotFound then
render :controller => "application", :action =>
2008 Feb 13
5
Example controller spec no worky?
I''m trying to spec a dead simple "show non-existent record should render
404" case, but it seems the RecordNotFound exception is making it
impossible for some reason.
#controller
def show
@event = Event.find(params[:id])
end
#spec - pretty much straight from the rspec site
before do
Event.stub!(:find)
get :show, :id => ''broken''
end
#
2010 Apr 19
3
which views are rendered for an URL
Hi,
Is there a way I can figure out which files are run for a specific
URL?
Given http://www.planet.com/countries files like: countries/
index.html.erb, countries/_country.html.erb, layouts/
application.html.erb and so on.
Thank You
--
M.
--
You received this message because you are subscribed to the Google Groups "Ruby on Rails: Talk" group.
To post to this group, send email to
2008 Dec 14
2
custom REST action - template question
Hallo phorum,
i have custom rest action.
routes.rb:
map.resources :schools, :collection => { :graduations => :get }
SchoolsController:
def graduations
@schools = School.graduation(true)
end
link somewhere in navigation:
<%= link_to ''Schools with graduation'', graduations_schools_path %>
All works OK for me, but Rails needs (of course) a template for
controller
2009 Jun 13
8
Removing routes to new, show, etc. in a model
Example model: demo
--app
----Controllers
------application_controler.rb
------demos_controller.rb
----Models
------demo.rb
----Views
------demos
--------index.html.erb (I want to keep this)
--------edit.html.erb (delete)
--------new.html.erb (delete)
--------show.html.erb (delete)
http://localhost:3000/demos/new (should not be a route)
http://localhost:3000/demos/edit (should not be a route)
2007 Sep 18
2
rSpec / Nested Routes / Mocks
I''m having a terrible time trying to test a nested route with rSpec.
I can''t seem to tell rSpec to expect the call @item.user. The
following error message plagues me not matter how I try to fuss with
the mock:
Spec::Mocks::MockExpectationError in ''ItemsController handling POST /
items should redirect to the new course on successful save''
Mock
2013 Feb 10
0
Nested attributes doesnt get updated
Hi
Am building a nested form and my code works fine with sqlite3 but throws
errors when using Oracle during update action.
Am getting the following error:
ActiveRecord::RecordNotFound in AWRequestsController#update
Couldn''t find WADetail with ID=5000000015 for AWRequest with ID=5000000022.0
Request
*Parameters*:
{"utf8"=>"✓",
2009 May 03
0
HTTP Auth 401 Even on Valid Login
I can''t understand why authenticate_or_request_with_http_basic keeps
failing even though I am entering the correct info.
If I try to access /admin/items/new, I enter the correct info but I
keep getting prompted.
The strange part is that when I cancel out, I get "HTTP Basic: Acce".
Here''s the controllers:
class Admin::BaseController < ApplicationController
2007 Mar 21
0
Getting the module name with ObjectSpace...
Hey :)
I''m trying to create a method for making a sitemap dynamically. It
works great for flat sites where you simply have your controllers in
the app/controllers directory. In this case, I can extract the
controller names like,
@controllers
ObjectSpace.subclasses_of(ActionController::Base).each do |obj|
@controllers["#{obj.controller_name}"] = obj
end
However,
2009 Apr 19
1
Cucmber: Mysql::Error: query: not connected: ROLLBACK
Hi,
I ran in trouble with unexpected rollbacks using cucumber 0.3.0.
My feature-file looks like
Scenario: Create Valid Item
Given I start
and the step is
Given /^I start$/ do
get "/items"
end
In my log/test.log I get
SQL (0.2ms) SET NAMES ''utf8''
SQL (0.2ms) SET SQL_AUTO_IS_NULL=0
SQL (0.1ms) BEGIN
Processing ItemsController#index
2011 Nov 10
1
url helper in model.js.erb.cofee (Sprockets::Context)
hello,
I am writing a js/coffee file that gets erb handling and I need to use
a url helper inside this file
if write
..
url: ''<%= url_for(:action => :index) %>''
I get an error:
NoMethodError Exception: undefined method `url_for'' for #<#<Class:
0xbdbb068>:0xeed1eb8>
>>self.class
#<Class:0xbdbb068> < Sprockets::Context
How do I
2011 May 28
0
Two buttons respond do same action.??
Hey
I am using rails 3.0.7.I created two buttons simply as:
<%= button_to "Great", :action => "click"%>
<%= button_to "click me", :action => "work"%>
Router.rb file looks like:
Check::Application.routes.draw do
# get "gne/clg"
get "posts/index"
resources :posts do
end
#get
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 =>