Displaying 20 results from an estimated 30000 matches similar to: "Are there any distributed commercial rails apps?"
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
2006 Apr 02
2
Problem with RSS feed from Rails Recipes
I''m trying to add an RSS feed to my app, and am going through the
Rails Recipes chapter on doing so. I get the following error when I
request the feed:
undefined method `gmtime'' for #<DateTime: 1963061961/800,0,2299161>
...
7: xml.pubDate CGI.rfc1123_date(@posts.first.created_on)
Any idea what''s up?
Pat
2005 Dec 21
6
Rails without a db - how to run tests
I''m writing a simple app that doesn''t need to use a database. I added
:active_record to the config.frameworks -= line in environment.rb
file. This lets me run ./script/generate fine without complaining
about no connection. However if I try to run a functional test, it
complains about no connection being established. Well...I don''t want
a connection to be established.
2006 Dec 20
16
Edge RSpec on Rails...what did I forget?
Started a new Rails project, and installed RSpec and the Rails plugin
vendor/plugins/rspec (svn://rubyforge.org/var/svn/rspec/trunk/rspec) - 1332
vendor/plugins/rspec_on_rails
(svn://rubyforge.org/var/svn/rspec/trunk/rspec_on_rails/vendor/plugins/rspec_on_rails)
- 1332
Generated the rspec file, created a model...the spec runs fine if I do
ruby spec/models/foo_spec.rb. Running rake though gives
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
2007 Feb 07
5
Mocking ActiveResource
I want to use ActiveResource in my app. Instead of hitting server
though, I want it to load from a file when I call find. Any clue how
I do that?
Pat
2007 Mar 14
5
What''s the new syntax for predicates?
@settings.should allow_publish_ip("127.0.0.1") fails with
undefined method `allow_publish_ip'' for #<#<Class:0x2f8fd48>:0x2f5a968>
@settings.should_allow_publish_ip("127.0.0.1") works fine
This is rspec 0.8.2.
http://rspec.rubyforge.org/documentation/expectations.html says that
matching arbitrary predicates is deprecated and to see
2007 May 21
4
Just upgraded to 1.0.0, should render_text isn''t working for me
I finally got around to upgrading from 0.8.2 (!!). I had a spec which
looked like
specify "should render abc123" do
controller.should_render :text => "abc123"
get :key
end
With 1.0.0, the new spec is
it "should render abc123" do
get :key
response.should render_text("abc123")
end
However it doesn''t work, giving me the error:
undefined
2006 Jun 07
6
I want to stick my models in a module
I''ve got enough models now that I''d like to separate them into
modules. For example, I have the class Player that I want to stick in
the Trainer module. I''ve changed the definition to
class Trainer::Player
I''ve created a models/trainer dir, test/unit/trainer, and
test/fixtures/trainer. Change the PlayerTest class to be
Trainer::PlayerTest. I get the
2006 Apr 01
3
Can I do a redirect in an ajax request?
I''ve got a form on my page, and when the user submits it, sometimes
I''d like to update an element on my page, and sometimes I''d like to
redirect the browser to another url entirely. However if I do
redirect_to, it just updates the element with the results of the
redirect. Is it possible to do what I want, or will I need to use RJS
to do this?
Pat
2006 Mar 05
6
Which postgresql adapter to use for rails core? How about production?
I wanted to fix some things up in the trunk, so I set up the databases
and ran the unit tests. A bunch fail for postgres, and even more
error out. I know of two postgresql adapters: postgres-pr and
ruby-postgres. Strangely, they each fail different tests. So if I
want to fix things up, which one should I be using? For that matter,
which adapter should I be using for production? Finding out
2007 May 04
5
Problems with mongrel_cluster 1.0.1.1 on FreeBSD
I''m running FreeBSD 6.1 and installed the 1.0.1.1 mongrel_cluster
prerelease. I had a problem with the mongrels not stopping, and it
turns out it''s because ps is reporting my processes as just
[ruby18]
instead of someting more like "mongrel_rails start -d ......."
Not sure why it''s doing that, but it is. Any ideas?
For the time being I just changed line
2006 Jul 22
12
Community request - can someone show me REST?
I mentioned this in another thread, but I''ve got a formal request now.
After reading tons of stuff about REST, I don''t really get it. I
need to see an example.
I''d like someone to write up an example blog app with these requirements
- RESTful using the simply_restful plugin (or edge rails)
- allows posting of comments to articles
- has categories for posts
No need
2006 Mar 19
3
How can I access an attribute via a symbol?
In my model I''d like to write a method that accesses the attributes by
name. A very simple implementation would be
class MyModel < ActiveRecord::Base
def get_value(attribute)
return value_of_attribute
end
end
Then I can call it with m.get_value(:name) to get the value of the
name column in the db. I''m not sure what to put in for
2007 Feb 23
4
How can I spec this? The method gets passed a block...
I''m using Jim Weirich''s Builder library. The code I want to spec is
xml.video do
xml.id @video_id
xml.views @views
xml.date(@date.to_s) if @date
end
I''d like to mock it, rather than asserting that the XML is the right
string. I can do one spec:
specify "should create a video tag" do
@mock_builder.should_receive(:video)
2007 Apr 09
7
RCov results seem to include the spec files
I saw the RCov page at http://rspec.rubyforge.org/tools/rcov.html and
decided to add it to my project. My rakefile looks like this:
require "rake"
require "spec/rake/spectask"
desc "Run all specs with RCov"
Spec::Rake::SpecTask.new("spec:rcov") do |t|
t.spec_files = FileList["spec/**/*_spec.rb"]
t.rcov = true
end
When I run rake spec:rcov,
2006 Jan 30
4
What is supposed to happen when you run dispatch.fcgi?
I''ve seen a number of posts where someone says, "What happens if you
just run dispatch.fcgi directly?" Every time I do it, I get a "500:
internal server error" message. I was just curious if that''s what''s
expected running it directly. I assume so, because my apps all work
fine, but that''s always bugged me.
Pat
2007 Sep 04
7
Rake tasks getting in the way of edge (uses gem instead)
So I''d been running gem releases of rspec for the past several months,
and I installed edge rspec so that I can use Story Runner.
I''m running into a problem because I''ve got a couple rake tasks that
reference "spec/rake/raketask". If I try to run "rake spec" then it
pulls in the gem version instead of the plugin version. rake blows up
saying that
2006 Aug 05
4
Can we use ActiveResource yet?
I need to split some information up between two servers, and wanted to
use REST for it. I can write the REST server really easily...but I
don''t know how I can actually use it. I downloaded Rails trunk to
mess with ActiveResource, but it seems that it doesn''t have create
functionality enabled yet.
Is it possible to use AR fully? If not, what''s the best way to
consume
2006 Apr 03
4
Clearing out filters in ActionController
I want to run a single filter in my application.rb file, and then if a
certain condition is true, end the action''s processing immediately.
Right now I''m using prepend_before_filter to ensure that it gets run
first, but some of my around_filters are still being processed. Is
there a way that I can clear out all the filters that should be run?
Basically it''ll look