Displaying 15 results from an estimated 15 matches for "resource_controller".
Did you mean:
resources_controller
2008 Jan 26
0
RSpec and resource_controller plugin
I just discovered James Golick''s resource_controller plugin
http://jamesgolick.com/resource_controller after spending another
stretch of boredom making the changes to nest yet another rails
resource controller. I''d actually slowed down this time to think
about what I was doing in hopes of automating the task.
I''ve tended to use s...
2008 Mar 16
3
undefined method `redirect_to'
Hi all. I''m getting the following error in my app:
undefined method `redirect_to'' for ActionController::Base:Class
I''m using Windows 2000, Rails 2.0.2 and resource_controller (from
James Golick).
My controller:
class CommentsController < ApplicationController
include ResourceController::Controller
belongs_to :post, :article, :photo
create do
ActionController::Base.redirect_to :back
end
end
I''ve been also trying to use the following:...
2008 Apr 24
3
DRYing up controllers
Hi
I''m a big fan of plugins such as Resource Controller
http://jamesgolick.com/2007/10/19/introducing-resource_controller-focus-on-what-makes-your-controller-special
However, recently decided I don''t want to depend on a plugin for this,
and would rather stick closer to the rails core.
So does anyone have any cool strategies or ideas for achieving this?
Or is there any move to make this possible in the edge...
2008 Dec 19
3
Recommended way of restricting action permissions?
Hi, I just have a "best practices" question. I''d like to block users
that don''t own a particular resource from performing edit/update/
destroy actions on it. Here''s how I currently do it:
## User has many resources, of different types
------- resource_controller.rb -------
before_filter :require_ownership, :only => [:edit, :update, :destroy]
... public actions ...
protected
def require_ownership
@resource = Resource.find(params[:id])
redirect_to_somewhere unless owns?(@resource)
end
------- application.rb -------
def owns?(resource)
resource...
2010 Jan 25
9
skinny Controllers, fat models with REST?
Hi,
I''m really new to rails, so i programmed some stuff and today i read
some things about skinny Controllers, fat models.
My Controllers are really fat now. So i''m asking myself how can i
shrink my controllers and move the code to the models, especially in
fact of REST e.g. in focus on error codes?
code example:
# POST /tasks
# POST /tasks.xml
def create
@authorized
2010 Dec 20
4
Subselection by URL
Hey guys,
I''m quite new in RoR, so please excuse me when I may ask weird
questions.
I am working on a database frontend. The layout looks mostly like
a has_many bs
b has_many cs
c has_many ds
and so on. Now I want to do some selection. Maybe I want to see all ds
belonging to a specific b. I would like to do it like:
http://my.host/bs/1/ds
When I click around there (add new ds, show a d
2007 Dec 27
6
ActiveResource and (polymorphic) associations
Hi,
I''m just playing with ActiveResource and I did''nt find anything about
the support of (polymorphic) associations.
Is there a support at all?
Thanks in advance
--~--~---------~--~----~------------~-------~--~----~
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
2012 Oct 18
0
unexpected return (LocalJumpError) only when executing this code within autoloaded classes?
...cies.rb:251:in
`require''
from
/path/to/.rvm/gems/ruby-1.9.3-p194@some_app_gemset/gems/activeadmin-0.5.0/lib/active_admin/base_controller.rb:2:in
`<top (required)>''
from
/path/to/.rvm/gems/ruby-1.9.3-p194@some_app_gemset/gems/activeadmin-0.5.0/lib/active_admin/resource_controller/actions.rb:2:in
`<module:ActiveAdmin>''
from
/path/to/.rvm/gems/ruby-1.9.3-p194@some_app_gemset/gems/activeadmin-0.5.0/lib/active_admin/resource_controller/actions.rb:1:in
`<top (required)>''
from
/path/to/.rvm/gems/ruby-1.9.3-p194@some_app_gemset/gems/ac...
2012 Oct 17
2
autolog: set_trace_func without all the typing
If it helps anyone developing Rails, apps, or gems, I wrote a shortcut for
set_trace_func, so next time you want to just add a line before and after
some function you are trying to debug you can have Ruby temporarily output
every line, method, etc. executed. Also, it lets you define the format, use
other loggers, etc. via a proc/lambda define, since you might not like the
default format.
2010 Nov 30
2
Did I miss a meeting?!
I''ve just stumbled (literally, while I was trying to fix a glitch I
was having after upgrading Aegis...) on the Inherited Resources gem...
why did no-one tell me?! ;-)
Is everyone else using some form of controller base-class? Am I the
last on this bus!
https://github.com/josevalim/inherited_resources
--
You received this message because you are subscribed to the Google Groups
2008 Oct 31
10
Strange dependency error after going Ruby1.8.6, Rails 2.1.0 -> Ruby1.8.7, Rails 2.1.2
Hi,
I''m getting an error I just can''t find any cause for.
The error is "A copy of ApplicationHelper has been removed from the
module tree but is still active!" and gets thrown
in a Template that uses a method defined in my ApplicationHelper. The
error occurs only in development mode.
The error did not occur before my switch to Ruby 1.8.7 and Rails 2.1.2
minutes ago.
I
2007 Mar 24
1
spec''ing metaprograming & rails CRUD
For edge rails there is a Crud generator. There is also a CRUD
controller that is out there from which you can inherit your other
controllers (see http://geekonomics.blogspot.com/2006/07/crud-and-
shared-controllers.html)
This got me thinking about Crud controllers in general. As far as I
know, the generator can''t produce crud classes which are nested
(i.e.
2009 Jun 22
1
getting error can't modify frozen hash
Hi,
When I upgraded my rails application to rails 2.3.2 I am getting
error ''can''t modify frozen hash'' on using
@something.update_attribute(params[:something]).
Can anyone help me who is familiarize with this bug?
Thanks,
2009 Feb 09
9
fastercsv, freezing into vendor/gems
I''m using fastercsv such that in my rake file I''m doing this.
require ''fastercsv''
It works fine on my Mac.
I need to freeze this gem into the app though so my rake tasks work on
the production machine.
-----------
I spent about two hours though this weekend trying to get this Gem
"frozen" into the vendor/gems folder. I tried all sorts,
I ...
-
2007 Mar 24
0
Using spec fixtures with integration tests
...eign key relationship
>> # this could also be found dynamically
>> end
>> end
>> end
>>
>> class CommentsController < CrudController
>> model :comments
>> belongs_to :post
>> end
>
> You might want to look into the resource_controller plugin: (http://
> svn.ardes.com/rails_plugins/resources_controller/
>
> It does what you''re describing in a very nice way and supports nested
> as well as acts_as_tree situations.
>
> Michael
> -------------- next part --------------
> An HTML attachment was s...