Displaying 20 results from an estimated 20000 matches similar to: "Grouping controllers into modules"
2006 Apr 03
2
undefined method `scaffold'' for #<LocationsController:0xb7a9e858>
Would anybody know why I get this error from this bit of code:
class LocationsController < ApplicationController
def index
scaffold :locations
end
end
This is the way that is demonstrated in the screencast for creating a
quick scaffold. I have done this before. However, I come back to
working with Ruby after about a month on something else and now it
gives this error.
Any
2006 Aug 04
4
DRY DRY DRY
Hello everyone!
Ive been on rails for the last month or so and really enjoyed this
framework.
However its very hard to find documentation on how to do things right!
For example every beginner after a while realizes that having similar
CRUD actions in every controller and views for them is not DRY at all!
Few days ago I found http://dereksivers.com/rails-shared-controller.html
I quite like his
2006 Aug 03
5
DRYing up the view
Hello everyone!
I have generic views for CRUD operations
For example I render(''shared/list'') from controller
shared/list.rhtml
...
<% for item in @list %>
<tr class="<%= cycle ''list-line-odd'', ''list-line-even'' %>">
<%= render :partial => ''item'', :locals => { :item => item } %>
2006 Dec 10
5
model-controller-paradigm: What about admin controllers?
Hi all
We all know the model-controller-paradigm: I have a model "News" which
has a corresponding CRUD-controller "NewsController".
But now I''m quite unsure about the following...
Guess we have normal visitors that visit our site www.??.com/news and we
have administrators that create and modify news items.
The admin should see an "Edit" link and a
2006 Jan 21
0
helpefying a list partial
Hi all,
I''ve got this code which is alway the same. In a list it displays a show, edit
and destroy icon behind each record.
<% for todo in @todos %>
<tr valign="top" class="ListLine<%= cycle("0","1") %>">
<td><%=h todo.prio %></td>
<td><%=h todo.title %></td>
<td><%=
2006 Aug 05
0
Another generic CRUD controller
I''ve been using this template on most of my CRUD controllers.
class CommentsController < ApplicationController
meantime_filter :set_scope
before_filter :find_comment, :only => %w(show edit update destroy)
def index
@comments = Comment.find(:all)
end
def new
@Comment = Comment.new
end
def create
@comment = Comment.create!(params[:comment])
2006 Mar 29
3
Grouping Controllers into Modules - Doesn''t work!?
Ok, what I want to achieve is:
http://<mydomain>/admin/products
calls app/controllers/admin/products_controller.rb
According to Agile Development with Rails this should work.
I executed the follwing commands:
rails myproj
cd myproj
script/generate controller Admin
script/generate scaffold Admin::Product
this creates app/controllers/admin/products_controller.rb all the views
&
2006 Jan 30
2
Modules, controllers and inheritance
Hi!
I was trying to cleanup my app and I runned into quite a problem. My
controllers in submodule do not seem to inherit things from base
class.
I have following setup:
app/controllers/
application.rb:
class ApplicationController
admin/
admin_controller.rb:
class Admin::AdminController < ApplicationController
include LoginEngine
include UserEngine
2006 Feb 04
2
file_column path problem grouping controllers in to modules
Hey there,
good job with the file_column thing, but I''m experiencing a problem I
didn''t found about.
I''m grouping controllers in to modules (like Admin::Category Admin:Item) and:
url_for_file_column("dettaglio", "picture_url")
return this search path:
src="/detail/picture_url/development/5/dark.jpg"
there''s a development coming from
2008 May 19
4
REST urls and Authenticity Token
Hi,
I have a few questions regarding REST and the Authenticity Token. I''m
using a RESTful aproach for my small project and everything worked fine
untill I wanted to destroy a record.
Lets say we have a listing of folder (a folder is just a record) and I
want to destroy one by using this link:
<%= link_to image_tag(''icons/folder_delete.png''), {:url =>
2006 Jan 21
1
Sortable Element with Partials?
Hi Everyone,
I posted this last month and unfortunately, I didn''t recieve any
replies. Maybe this time I''ll have better luck. I originally had my
sortable element list working properly like so:
<ul id="sortable_list">
<% @items.each do |item| %>
<li id="item_<%= item.id %>"><%= image_tag "dragme.gif"
2007 Mar 19
3
controller_name with dynamic controllers
I''m writing a controller which should only be inherited from,
something like the generic crud controller seen here: http://
geekonomics.blogspot.com/2006/07/crud-and-shared-controllers.html
Now, in my spec, I would like to create a controller which inherits
from the generic CRUDController, without actually creating the
controller. This controller is *only* for testing.
How can I
2009 Dec 28
2
How to get parameters to controller from view using <input tag?
Hello! I''m everywhere searching the answer for my question. How to get
parameters to controller from view using <input tag. But I want to do
this without db. I have the code:
class TranslateController < ApplicationController
def start
@time = Time.now
end
def result
@rez = params[:name]
end
end
<html>
<head>
<title> Translate numbers from 10 to
2006 May 06
0
RE: Rails Digest, Vol 20, Issue 156
I am looking for a ruby hosting service. Can any one recommend one for me.
-----Original Message-----
From: rails-request@lists.rubyonrails.org [mailto:rails-request@lists.rubyonrails.org]
Sent: Saturday, May 06, 2006 7:37 AM
To: rails@lists.rubyonrails.org
Subject: Rails Digest, Vol 20, Issue 156
Send Rails mailing list submissions to
rails@lists.rubyonrails.org
To subscribe or
2008 Feb 16
2
nil error?
Hi everyone,
I''m sure I''m doing something stupid with this, so if somebody could talk
some sense into me that would be great :)
I''m trying to just increment a variable and I think I''m missing some
basic concept (this is RoR 2.0.2 btw)
So have a "players" table with several variables, including one called
"odds". I''m using the
2006 Aug 14
1
Testing CRUD/Rest Controllers
I have a few simple controllers doing plain, simple crud in a standard way.
now it''s not very DRY to write a funtcional test for each controller, since
they are all doing the same (apart from a few variable names, but that could
be easily inflected or so).
is there a way to do this?
e.g. does inheritance work with tests, so i define a base test first,
inherit my other tests and add a few
2006 Aug 18
0
Impact of inheriting controllers on models
I have some protected methods and authentication/acl filters I want to
inherit down through my controllers.
So I have controllers which inherit like this:
Application_controller
\
-- AdminArea Controller
--\
----dashboard controller
----user controller
----content controller
----\
------page controller
------placement controller
-- PublicArea Controller
--\
........
At the deepest level the
2006 Jul 04
0
Multiple and nested controllers or routing
Hi,
I''m new to Ruby and Rails and I''m making a simple application to help me
learn how to use it. At the moment I have an admin controller. When the user
goes here I want them to be presented with 3 choices: manage photos, news
and pages. From there I want them to be able to CRUD each type.
At the moment in the admin controller I''ve defined actions "photo",
2006 Nov 04
0
Controllers and Namespaces (no problem, just questions)
I''m a little late on finding this article:
http://habtm.com/articles/2006/07/01/if-your-models-arent-namespaced-why-should-your-controllers-be-or-how-i-learned-to-stop-worrying-and-love-the-crud
This idea does not sit well with me and am curious as to the Rails roadmap.
I''ve seen a couple things demonstrated in examples (Rails Book, api) that
later turn to become deprecated. As
2008 Jan 29
4
map.resources for controllers in a module
Hello-
I''m giving RESTful development a shot. I''m running into some difficulty
with controller I have grouped into modules. Specifically, I have a
"admin" module with a "user" controller (created with "generate
controller admin/user"). I managed to get map.resources wired up with
this code:
map.resources Admin::User, :path_prefix =>