search for: joshpeek

Displaying 20 results from an estimated 20 matches for "joshpeek".

2006 Aug 03
6
Listing all of a nested Resources
I''ll use the example on the Rails blog. map.resources :posts do |posts| posts.resources :comments, :trackbacks end Now comments are at /posts/:post_id/comments. Okay but what if I want to list all the comments for all the posts. It should be at /comments, but that isn''t map that way. Can I map comments twice? -- Posted via http://www.ruby-forum.com/.
2007 Jun 28
23
DRYing link_to with a symbol
Hi, I just put in a patch that allows you to DRY up this: <%= link_to @company.name, @company %> to this: <%= link_to :name, @company %> The symbol indicates the method to be called on the object passed in the link_to options. http://dev.rubyonrails.org/ticket/8789 --~--~---------~--~----~------------~-------~--~----~ You received this message because you are subscribed to the
2006 Jul 04
3
act_as_state_machine plugin inaccessible
Seems like act_as_state_machine plugin is not accessible from http://lunchroom.lunchboxsoftware.com/articles/2006/01/21/acts-as-state-machine as this site is down and script/plugin discover is broken as it fails when trying to add plugin repositories giving the message as below; Add http://svn.northpub.com/plugins/? [Y/n] y (eval):3:in `each'': undefined method `[]'' for
2006 Nov 27
3
Consistency in REST-routes naming
Hello everyone! In working with the Rails-REST-features I have always wondered about the URL for the new-action /objects/new In REST the URL should represent a Resource. As the semicolon is for adding non-standard actions (verbs) to a resource, IMHO it should be: /objects;new and not /objects/new In fact, this is just like an additional action, which I would specify with the
2006 Jul 24
0
Dynamic Scope plugin
...er_id => params[:user_id] } }) { yield } scope_messages_to_mailbox { yield } #=> Message.with_scope({ :find => { :conditions => [ ''mailbox_id = ?'', params[:mailbox_id] ]}, :create => { :mailbox_id => params[:mailbox_id] } }) { yield } SVN: http://joshpeek.com/svn/plugins/dynamic_scope/ -- Posted via http://www.ruby-forum.com/.
2006 Jun 30
2
Simply Restful: Can''t create update forum
Views <code> <% form_for :user, @user, :url => { :action => "update" }, :method => :put do |f| %> ... <% end %> </code> Outputs <code> <form action="/users/1" method="post"> ... </code> It sends post instead of put. I don''t see any hackish hidden put stuff in the form either. -- Posted via
2007 Dec 20
0
Fwd: [ mocha-Patches-16424 ] Ruby 1.9 Compatibility
...ty To: noreply at rubyforge.org Patches item #16424, was opened at 2007-12-19 02:43 You can respond by visiting: http://rubyforge.org/tracker/?func=detail&atid=7479&aid=16424&group_id=1917 Category: None Group: None Status: Open Resolution: None Priority: 3 Submitted By: Joshua Peek (joshpeek) Assigned to: Nobody (None) Summary: Ruby 1.9 Compatibility Initial Comment: Ruby 1.9 Compatibility Tested on * ruby 1.8.6 (2007-09-24 patchlevel 111) [universal-darwin9.0] * ruby 1.9.0 (2007-12-11 patchlevel 0) [i686-darwin9.1.0] ---------------------------------------------------------...
2007 Jan 08
0
[PATCH] auto_discovery_link_tag with more bacon!
...6941? Makes auto_discovery_link_tag accept tons more content types. auto_discovery_link_tag :xml, formatted_posts_url(:xml) => <link href="http://localhost:3000/posts.xml" rel="alternate" title="RSS" type="application/xml" /> -- Josh Peek http://joshpeek.com/ --~--~---------~--~----~------------~-------~--~----~ You received this message because you are subscribed to the Google Groups "Ruby on Rails: Core" group. To post to this group, send email to rubyonrails-core@googlegroups.com To unsubscribe from this group, send email to rubyonr...
2006 Aug 02
0
Updating scaffolding to better fit Resources
...d this planed from the beginning). The current scaffolding should be modified to better fit Resources. Scaffolding doesn''t need to be redone, it just needs a few tweaks. I''ve already started converting the scaffold method. I made a plugin, but it still needs some work. http://joshpeek.com/svn/plugins/crud_scaffold/ I was about to convert the scaffold generators but I found an announced plugin in Rick''s repo. http://svn.techno-weenie.net/projects/plugins/resource_generator/ -- Posted via http://www.ruby-forum.com/.
2007 Aug 23
3
test/mocks/ in rails directory structure
Anyone ever uses test/mocks/development && test/mocks/test directories ? If someone does, test/mocks/development doesn''t really seem like a nice place for putting development environment mocked classes. May be mocks/ should be moved to RAILS_ROOT ? Or may be it should be removed. Views ? -- Cheers! - Pratik http://m.onkey.org
2007 Sep 14
4
Refactoring ActiveRecord's private methods
As it currently stands, ActiveRecord has alot of private and protected methods in the Base class. >> ActiveRecord::Base.methods.size => 427 >> ActiveRecord::Base.protected_methods.size => 32 >> ActiveRecord::Base.private_methods.size => 193 I really loved the suggestion by Courtenay in Refactoring AR::Base.find (http://groups.google.com/group/rubyonrails-core/
2007 Jul 18
16
Edge Rails namespaced routing
Hi, I was wondering if anyone came across a similar scenario when working with namespaced routes with edge rails. Consider an application with controllers customers and products that also have other resources. map.resources :customers do |customer| customer.resources :notes customer.resources :tags end map.resources :products do |product| customer.resources :notes customer.resources
2006 Jul 24
1
meantime_filter won''t pick up my missing methods
<code><pre> module Scope protected def method_missing(method_id, *arguments, &block) if method_id.id2name =~ /^scope_([_a-z]\w*)_to_([_a-z]\w*)/ scope_model($1.singularize.capitalize, "#{$2}_id", &block) else super end end def scope_model(klass, foreign_key, &block) eval(klass).with_scope({ :find =>
2006 Jul 27
0
Override default Rail Generator options
I''ve been hacking at this for hours now. I found a method called ''default_options'' in Rails::Generator::Base. By default it calls ''default_options :collision => :ask, :quiet => false''. I''d like to over ride it with my own options. It works if I just change it in the Rails source but thats not a real solution. Is there any way to set
2007 Jun 12
0
Ticket #8614: Correct default page cache url
> Currently if you use page cache, Rails will take the default route for > controller the controller to construct the path. > > If you wanted to cache the root url (see example below), Rails will create > the cache at /welcome/index.html. Not really what we want. > > map.root :controller => "welcome" # Page cache defaults to >
2007 Dec 24
0
Update OpenIdAuthentication to use Ruby OpenID 2.x.x
The new Ruby OpenID library has been released and it has a bunch of major changes from 1.x.x. This patch updates the OpenIdAuthentication plugin to use the 2.x.x version. I wouldn''t usually feel much pressure to upgrade, however the ruby- openid 1.x.x gem is broken after Ruby Gems 1.0 was released. I think we should also consider freezing ruby-openid in this plugin so this type of thing
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 Jul 26
4
create! should return an Active Record object no matter what
I just using the bang versions of save and create after seeing Rick (technoweenie) use it in his code. I like it much better. I have a problem with the create! method. It doesn''t return an Active Record object if it fails. That means you can''t display the errors on the object. Whats the point than? Here is a broken example that should work. def create @product =
2006 Aug 08
4
Nic’s Magic Models, how about Magic Schema
I side with David when it comes to databases. They suck! Just my own opinion. So what about the people who don''t want to define validations and stuff in the database, but still want to be DRY. I really hate how the schema is separate from my models. I kind of like how Django defines the table attributes in the model. I was think about trying something like that in Rails. You could
2006 Aug 03
4
Map a resource that is a join model
How should you map resources that are join models like Memberships? Lets say have you have Members and Groups that are joined through Memberships. map.resources :members do |members| members.resources :groups do |groups| groups.resources :memberships end end This doesn''t seem right. It would be nice to access all members, groups, and memberships at /members,