similar to: Refactoring controllers vs. actions

Displaying 20 results from an estimated 8000 matches similar to: "Refactoring controllers vs. actions"

2007 Aug 19
6
layout inheritance
According to "Ruby On Rails", the layout call is suppose to be inherited: (page 508) "Subclasses of a controller will use the parent''s layout unless they override it using the layout directive" I have a case where this is not working. I have not spent time to concoct a stand alone test. I wanted to verify that David''s book is correct first. Can someone
2006 Jul 12
6
So what is REST? I don''t get how it fits in Rails
Does someone have an actual example of this? I saw DHH''s slides where he said that you could have your app automatically respond with HTML, XML, atom, whatever. So far I''ve found tons of discussion on REST and CRUD in Rails, but I haven''t seen anything that actually shows me what it all is. There''s simply_restful, which apparently makes things easier...I
2006 Jul 26
5
Can we have have protected methods in our REST controllers?
I gotta be quick, sos if it seems rushed. Latest word from DHH is that the REST conttrollers should only have 4 methods : Create, Update, New, Delete If you don''t know about DHH''s latest thing then leave now, or go read about it on his blog. Does this mean i can''t have private methods in my controller?? I have a method that create and new share. Thanks Chris
2006 Jul 21
2
New Generator: hasmanythrough
To the aide of anyone whose had to create new models, migrations and unit tests for the common many-to-many relationship, using "has_many :through" (that''s almost everyone). I''ve created a new generator that generates two model classes, plus a many-to-many relationship class, e.g. User, Group, plus the Membership model between them. It also generates the migrations
2007 Sep 03
13
Some basic questions
1. I have a text area in which I type on multiple lines..but when I display it, it prints whole text in one line..how can I solve that? Datatype is TEXT 2. I can see a list of all posts at ..post/ with index method but I want to see a particular post with ..post/[id] .. how can I do that? 3. I want my application to be completely secured and whatever page unlogged in user tries to open, it
2006 Feb 07
11
Possible Rails Security Issue?
I have an e-commerce site and users check out with a form. The results of that form are sent to a "confirm your order" page via POST. I take great pains to NEVER store the full credit card number on my server--just the last 4 digits. I was very surprised to find that by default Rails will record POST requests with parameters in the production.log. And those parameters
2006 Sep 14
4
AWDWR 2nd edition and REST
Question, and I''ll preface it by asking if this is the right list to be posting questions regarding anything past Rails 1.1.6 , (i.e. edgerails) ? In the latest revision of AWDWR there is a sample REST based app. During the creation of the controller and actions, there is a foot note that says: "7. By the time you''re reading this, there may well be support build into Rails
2006 Jul 07
4
Controllers - model vs. use case centric
I am working on a reasonably large application (which happens to be my first with rails). I was hoping to get some input on organisation of controllers and actions. I am finding having used scaffolding more at the beginning my controllers tend to be very model centric, in that they mostly contain all the actions for management of that particular model, which may crash across multiple use
2006 Jul 25
8
Creating records in two models in a RESTful way.
Hey everyone, I have a philosophical question here. Say I have a website that uses two models for accounts: Person and Company. Normally I would just have /accounts/new for user signup. However, the RESTful way to do it is to have /people and /companies. Unfortunately, this doesn''t account for a situation where you''d have a one-page signup form. I wouldn''t want
2006 Apr 05
4
Self-referential join creation/deletion and :through
Greetings. First, this example is just my way of exploring :through. It probably doesn''t need has_many :through, and could just use a standard HABTM association. Here''s the models: class CourseRequisite < ActiveRecord::Base belongs_to :requisite, :class_name => ''Course'', :foreign_key => ''requisite_id'' belongs_to :course,
2007 Jan 29
2
Secure Actions Plugin
Hi all, This plugin lets you specify which actions *must* be run under ssl (https). If a declared action is run without ssl, the user is redirect to https. Also, once you declare an action to "require_ssl", any links to that action are going to be https:// links. http://svn.ianwarshak.com/plugins/secure_actions Hopefully you all will find this useful. Ian
2006 Sep 16
10
Mongrel and Sandbox
Z-Man, DHH recently said: "And [_why''s] latest work on sandbox looks stellar. Making it drop-dead easy to run multiple Rails applications in the same Mongrel process without conflicts. Thumbs up to both him and Matz for getting Sandbox on track for inclusion with the next Ruby release." Does that mean what I think it means - that one or more Mongrel processes may one day be
2006 Jun 27
25
1.1.3 available.
Hello, DHH has just announced the release of Rails 1.1.3 http://weblog.rubyonrails.org/2006/6/27/rails-1-1-3-security-fix-and-minor-fixes rails-1.1.3 activerecord-1.14.3 actionpack-1.12.2 actionmailer-1.2.2 actionwebservice-1.1.3 The announce without the repetition :) "Rails 1.1.3: Security fix and minor fixes Posted by David June 27, 2006 @ 08:07PM We''ve found and fixed a
2006 Jan 17
30
MVC design good/bad
I am curious what you find is good and bad MVC design. Let''s use the find and find_by_sql methods as examples. Currently I have these spread out all over the place... View: here I have some find methods when I am for example populating a select list with choices in a form. Controller: here I have the simpler find methods. Model: here I have the more complicated find methods (usually
2007 May 04
11
spec template for CRUD?
Hello, Has anyone already come up with a set of shared behaviours that someone could leverage when adhering to a CRUD concept, with respect to controllers? Relatedly, it would be nice if there were a way to share generalized behaviour specs. -Chris
2006 Aug 04
4
REST
I''ve been looking into RESTful approaches lately. Everything I know my dog, Lelu, taught me. REST (REpresentational State Transfer) is an architectural technique for networked applications first described by Roy Fielding in his dissertation at UC Irvine-- excellent work, especially considering the tempting proximity of Newport Beach. As Lelu described it to me, REST strives
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
2006 Jul 24
8
Views in one controller reaching out to other controllers (best practices)
Hello all. For the purpose of my question, let''s imagine we''re building some search functionality. You''re a sales person (you poor sap). And you''re hanging out in the SalesCenterController. You need to do a search for available productions; you''ve decided to be cool and use Ajax. Do you... a) Make a remote call to an action in your current controller
2006 Jun 29
6
Naming Convention for Controllers?
Hello! I just read DHH''s presentation pdf. In his examples, he wrote PeopleController instead of PersonController. I''ve been using singular words in controller''s name. Which is more common? Thanks. Sam -- Posted via http://www.ruby-forum.com/.
2006 Feb 08
3
Basics - help with models &controllers...
I have looked at many rails apps source code from the web and it seems there is no best practice when designing the database schema and models. For example surely it is recommended to include your foreign keys and constraints at the database level? Some people just rely on the activerecord associations, and don''t bother even placing a field for the foreign key in the tables? I