search for: scaffold_resourc

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

Did you mean: scaffold_resource
2007 May 22
5
rails edge
hi, first time trying rspec, and rails edge. Are there any known issues running rspec with rails edge? for one, apparently script/generate scaffold_resource has been renamed just "resource". Do I just search/replace "scaffold_resource" with "resource" in file rspec_resource_generator.rb ? Somethings still missing. before i get "Couldn''t find ''scaffold_resource'' generator" after...
2006 Oct 06
1
8th method for scaffold_resource
I was reading a blog where at RailsEurope David spoke about adding a "search" method into the scaffold_resource. Anyway I haven''t seen anything else on it and wanted to know if there is any more information someone here could share. Stuart --~--~---------~--~----~------------~-------~--~----~ You received this message because you are subscribed to the Google Groups "Ruby on Rails: Core&quot...
2007 Apr 24
1
problem POSTing with curl and REST using scaffold_resource
...ompleted in 0.09300 (10 reqs/sec) | Rendering: 0.00000 (0%) | DB: 0.07800 (83%) | 201 Created [http://localhost/heartrates] =-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=- =-=-=-=-= This is the create() method (that handles the POST request) in the controller (generated by scaffold_resource) # POST /heartrates # POST /heartrates.xml def create @heartrate = Heartrate.new(params[:heartrate]) respond_to do |format| if @heartrate.save flash[:notice] = ''Heartrate was successfully created.'' #format.html { redirect_to heartrate_url(@hear...
2006 Nov 03
10
[PLUGIN] rspec_resource_generator - RESTful scaffold generator with RSpec specifications
rspec_resource_generator ======================== By Pat Maddox Use this generator to generate RESTful scaffolding with RSpec specifications. Syntax is exactly the same as the scaffold_resource generator: ./script/generate rspec_resource ModelName [field:type field:type] When you run this generator, it will create a migration, model, and model spec file. In addition, it gives you a RESTful controller with all the actions filled in, and a complete specification for the controller. View...
2006 Oct 27
1
scaffold_resource should create specs instead of tests
Is this in the works?
2007 Jan 10
0
nested resources with nested controllers
Is there a way to create resources that work with nested controllers? For example: ./script/generate scaffold_resource project name:string mkdir app/views/layouts/project # so the command below doesn''t complain ./script/generate scaffold_resource project::user name:string # routes.rb map.resources :projects do |project| project.resources :users end After creating a project and trying to list i...
2007 Feb 01
12
RESTful Rails and other musings
Hi all, I would first like to introduce myself to the Ruby on Rails (RoR) community and to say that I hope to begin to build some relationships with other RoR developers. I''m a long time Java programmer (5+ years). Java was my first experience with Object Oriented Programming (OOP). Before Java I developed using many other languages including C, Pascal, Fortran, BASIC, Visual Basic,
2007 Dec 06
3
number_to_currency
I am using the number to currency function because i live in the uk and the company want me to only show values of the pound of course.I have created all my application using ruby script/generate scaffold_resource.... I have come across with a problem... this code is in my applcation: def number_to_currency(number, options = {}) options = options.stringify_keys precision, unit, separator, delimiter = options.delete("precision") { 2 }, options.delete("unit") { "£" }, option...
2007 Jul 26
2
rspec_resource error
...ny mention of the rspec_resource generator?. When I run script/generate I get the following: Installed Generators Plugins: authenticated, rspec, rspec_controller, rspec_model, rspec_scaffold Builtin: controller, integration_test, mailer, migration, model, observer, plugin, resource, scaffold, scaffold_resource, session_migration, web_service Could anyone spread any light as to why rspec_resource isn''t being installed? Sorry for the simple question but I can''t seem to find any help on the rspec rubyforge page or through google. Any help would be much appreciated. Thanks, P [1] ht...
2006 Nov 18
1
ActiveResource sample code?
I''d like to play around a bit with ActiveResource for consuming a web service. Does anyone have sample code they would be willing to share? I''ve googled all around and have come up empty except for simple (non- working) examples given in the RailsConf keynote and some associated blog entries. Thanks! cr --~--~---------~--~----~------------~-------~--~----~ You received
2006 Nov 22
1
Peepcode REST podcast. ..didn't anybody get it ?
And if so, I''m going a bit bonkers here and need to watch it again, but if I remember correctly, scaffold_resource generator was used, but for nested resources the show and index were removed from the controller ? Is this correct as far as what happened in the demonstration and if so is it correct as far as rest goes ? TIA Stuart -- http://en.wikipedia.org/wiki/Dark_ambient --~--~---------~--~----~-------...
2007 Aug 01
2
map.resources with habtm
Hi I''m trying to use restful resources with recipes and ingredients I''ve set up the models using scaffold_resource. A recipe can have many ingredients and an ingredient can be in many recipes. I''ve set the relationships up using a through. I now want to display a recipe with a list of ingredients but I''m unsure how to proceed. Should I use nested resources and how do I add a new ingredient to...
2006 Oct 12
7
Evil Scaffold
I read the Amy Hoy''s presentation on why scaffold is not a good thing for beginners. For admin application, is it ok to use scaffold? --~--~---------~--~----~------------~-------~--~----~ 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
2007 Feb 24
2
RESTful PUT and button_to
...unter. It has a single column, "count": class CreateCounters < ActiveRecord::Migration def self.up create_table :counters do |t| t.column :count, :integer end end def self.down drop_table :counters end I''ve created a RESTful controller using the scaffold_resource generator. In the "show" view, I''d like to put a link which increments the counter by one: <%= h @counter.content %> <%= button_to "++", ??? %> If this were a traditional rails app, the next step would be obvious. I''d add an "increment&...
2006 Nov 04
0
New version of the AWDwR beta book available
...Davisdon''s chapter on deployment (this is an interesting one---JDD has strong opinions on how a Rails application should be deployed, and the chapter mirrors this. You''ll find it short and easy to follow). - I changed the Resource-based routing section to use the new scaffold_resources generator - it fixes a number of reported errata and includes a bunch of suggestions. To find out what''s changed, go to http://books.pragprog.com/titles/rails2/errata and select the version of the book you currently own in the dropdown. The grayed-out entries that appear are...
2008 Jan 26
0
RSpec and resource_controller plugin
...between browser pages. But it''s always ugly when I want to nest one of these generated resources. It always seems to take me longer than it should to make the changes in both the controller, the views, and the specs to get to square one. The plugin, which brings back the script/generate scaffold_resource with new meaning turns a controller that looks like this: class HardwaysController < ApplicationController # GET /hardways # GET /hardways.xml def index @hardways = Hardway.find(:all) respond_to do |format| format.html # index.html.erb format.xml { render :xml =>...
2007 Jul 09
2
Accessing model objects directly in the view
Is there any general guidelines for accessing model objects directly in the view? It seems like it would be a potential problem - that it would be better to keep model objects out of the view entirely. Instead, the controller should extract whatever data is needed from the model and put it into temporary objects, thus protecting the views from any changes in the models and keeping them from
2006 Nov 22
3
Controller Isolation
Hi, I have a project that I had running under rspec 0.6.x and recently upgraded to 0.7.2. I am trying to isolate my controllers from the database as I go through and change all the specs to run under 0.7.2. I am having a problem where I need to make the create! method return the mocked object as well as raise RecordInvalid exception. Is this at all possible? I use the rescue statement in my
2007 Oct 24
5
Do I have to care about other methods than GET and POST?
Hi all Sometimes I check in a controller if the method is GET or POST. But afaik there are other methods - do I have to care about them? Is the following enough? if request.get? ... elsif request.post? ... end Or do I have to add also an else block? if request.get? ... elsif request.post? ... else raise "Boah!" end Thanks for infos Josh -- Posted via http://www.ruby-forum.com/.
2007 Sep 25
21
form_for and partials
I love form_for, but I really hate <% form_for :person, @person, :url => {...} do |f| %> ... <%= render :partial => ''form'', :locals => {''f'' => f} ... <% end %> I''ve been thinking of instead allowing <% form_for :person, @person, :url => {...} do |f| %> ... <%= f.partial ''form''