similar to: RESTful controller naming conventions

Displaying 20 results from an estimated 5000 matches similar to: "RESTful controller naming conventions"

2006 Aug 16
1
Naming rights_roles join model using has_many :through and polymorphic associations
Hi. I have a couple of best practices questions regarding polymorphic associations, naming join tables and user permissions. Currently I have implemented the user authentication model from the rails recipes book. Basically it goes something like this: MODEL CLASSES: class User < ActiveRecord::Base has_and_belongs_to_many :roles end class Role < ActiveRecord::Base
2006 Jul 26
3
Polymorphic Association with Single Table Inheritance?
Hello, is it possible to setup a model/table schema like this: Groupable --> Membership <-- Group ^ ^ | | User UserGroup I tried the following but failed: Groupable (table with ''type'' column) has_many :memberships, :as => :groupable has_many :groups, :through => :memberships
2006 Feb 26
3
Rails Naming Conventions
DB field names: If I have a table that references 2 or more separate users from my users table, is there a recommended naming convention for this situation? In my case, I have 3 users associated with a record in my projects table: requester_user_id created_by updated_by I could name one of them "user_id", and then projects.user would work I guess, but wouldn''t work
2006 Jan 02
13
Naming Conventions
So, RoR is better at grammer than I. Well so is my nine year old. If I have a table named "people_type" will Rails see this as singular because of the _type or will it consider it the plural of "person_type" ? Is there a link to Rails that lists what words it knows, or what words not to use in table design etc. Kindest regards. -- Posted via http://www.ruby-forum.com/.
2006 Oct 16
0
Restful routes, not repeating yourself and non-standard rest actions best practices
So I''ve recently started playing with the restful routes support in edge rails, converting a few of my controllers to support all the standard operations.. One thing that''s been bothering me, however, is the following: Before using restul routes, I would define an edit method in my controller which would be responsible for both creating new objects as well as editing
2007 Sep 22
1
Testing RESTful routes
Hi all, The app I am making right now uses restful routing entirely. I want to prevent people from accessing my actions without the proper HTTP verb so I commented out the :controller/:action/:id catch all routes that were used in pre-RESTful Rails apps. Like so: #map.connect '':controller/:action/:id.:format'' #map.connect '':controller/:action/:id''
2007 Oct 05
1
RESTful Thinking
Okay, so I am trying to embrace the RESTful approach to web application design and wanted to get some feedback from others. I understand that it can be done different ways, I''m just interested to see what real RESTful theorists think. Lets say that you have an application that has lists and items on that list. I can see how both lists and items can be set up as resources. Now, lets
2006 Aug 01
2
restful controllers - howto nest with link_to?
Hi List, I''m trying to get my grip on the restful methods that are now part of edge rails. Making the first steps was impressive as well as easy because there are already great resources on the blogs of early adopters: http://www.ryandaigle.com/articles/2006/08/01/whats-new-in-edge-rails-simply-restful-support-and-how-to-use-itand
2006 Aug 11
0
Resotolog-1.2 - RESTful blog example (was Community request - can someone show me REST? )
On 8/2/06, Alisdair McDiarmid <alisdair@...> wrote: > Here you go: > http://randomoracle.com/stuff/RestBlog.tar.gz Hi guys, i modified a little the original Alisdair McDiarmid''s sources and created very simple blog system. So the announce follows: Restolog - RESTful blog example ========================= Very simple blog system based on REST/CRUD ideas. Sources (all
2006 Oct 27
6
Table naming conventions
Folks, I am new to rails. I have tried Google searches, checked the tips and doco and can''t find the answer to a simple question. I have a table called "Activity" that I want to rename so I can use RubyOnRails but I don''t know whether the plural form should be "Activitys" or "Activities". Can someone illuminate me on what to do? regards Simon
2008 Jun 01
2
Is Ezra''s RESTful recipe needed anymore?
Hi all, In the recent Advanced Rails Recipes book, Ezra states that Rails needs a little bit of adjustment for its restful routing to work with Facebook. He suggests created an initializer named facebook_overrides.rb and adding this code: http://pastie.caboo.se/206696 But I was just testing restful routing without that code, and Rails seemed to be working fine with Facebook.
2012 Nov 20
0
Proposed change to the broker RESTful API and CLI to handle parameters needed in additional broker plugins
Hi all; There has been a separate thread recently in this mailing list around adding a Chef broker plugin to Razor. As this effort has progressed, the realization has gradually sunk in that the parameters that are needed for a successful a handoff to Puppet might not be the same as the parameters that are needed for a successful handoff to Chef. That has left us with a couple of
2006 Oct 18
1
observe_field, GET method and RESTful controllers
Hi all. I am trying to work with restful rails and have come across a quandry with observe_field. I basically want the observe field to call a show action on a restful controller. However I am unable to do so because I cannot get the damn thing to use the get request properly. If I use the following: <%= observe_field("project_selector", :update =>
2007 Oct 26
0
Composite Keys on RESTful Routes
I am building an app with existing controllers/actions, using traditional rails routes. I recently started moving over to RESTful routes and have hit a snag. Now I am reconsidering my whole effort and may go back to the original, more flexible, map.connect method. My problem is, one of the resources has composite keys. The keys are both strings as well, and can include dots. Here''s
2007 Jul 23
0
any restful client other than active_resource?
Hi, I am trying to consume a restful resource. I tried active_resource with rails 1.2.3, but it doesn''t work. so I assume that it only works with Edge Rails. Is there any other ruby-based restful client available? Thanks. Yaxm. -- Posted via http://www.ruby-forum.com/. --~--~---------~--~----~------------~-------~--~----~ You received this message because you are subscribed to the
2007 Feb 05
0
How do I use a RESTful helper with path_prefix?
Once upon a time I had this in my routes.rb: map.client_home '':client/'', :controller => ''orders'', :action => ''new'' All orders must be scoped within a client name, so this worked quite well. I used a before_filter to scoop up the @client object by doing a find_by_name. Then I decided to expose the OrderController as a fully restful
2008 Jul 29
0
appending to a restful resource a custom format
Hi everyone, I would like to add the format and a custom field to all my restful resources, without touching my application (I don''t want to change all url_path to format_url_path to make things clear). For being more specific I want to add :format.:lang to my restful resources, so i can have /posts/1.html.en that map to the english page and /posts/1.html.it that map to the italian one.
2008 Nov 13
0
RESTful acts_as_tree
Hello, I was trying to use the acts_as_tree plugin and I got stuck when trying to do it in a RESTful way. I have a Place model that can have and belong to other places. What is the correct method of creating new places in a RESTful way? I don''t necessarily care about have an url / place/id/place/id. I''m mostly interested to know the correct way of passing the parent_id in order
2009 Dec 23
0
Migration from the "Restful Authentication" to "Authlogic"
Hi, I am using Authlogic for authentication. Previously our application having a "Restful Authentication". We have users who are created by using the "Restful Authentication". My problem is these users will not able to login with Authlogic as the password encryption methods are different for both and I am getting "Password not valid" error. So I searched for that and
2009 Apr 18
1
RESTful Routing: Getting names of resources out of paths
Hello - I''m trying to remain RESTful in a new application that I''m building, but I''m not sure how to get the routes that I want. I''m trying to avoid having resource names like "posts" and "comments" cluttering things up. For example, for a resource that I designate: GET example.com -> index GET example.com/1 -> show, id=1 GET