Controller like so:
def catalog
#Makes the request pause 1.5 seconds
sleep 1.5
...
end
Even better: only add the sleep for the dev environment.
Related Contents:
- How to get a random number in Ruby
- How to remove a key from Hash and get the remaining hash in Ruby/Rails?
- How can I specify a local gem in my Gemfile?
- How to replace a hash key with another key
- Rails: Open link in new tab (with ‘link_to’)
- Rails hidden field undefined method ‘merge’ error
- Deleting all records in a database table
- What is the difference between `after_create` and `after_save` and when to use which?
- Rails 3: Get Random Record
- All Ruby tests raising: undefined method `authenticate’ for nil:NilClass
- How to run Rails console in the test environment and load test_helper.rb?
- How do I run a Ruby file in a Rails environment?
- find() with nil when there are no records
- How do I strip non alphanumeric characters from a string and keep spaces?
- I need to generate uuid for my rails application. What are the options(gems) I have? [duplicate]
- How do I test a file upload in rails?
- Devise password reset from Rails console
- Convert UTC to local time in Rails 3
- validation custom message for rails 3
- Hash remove all except specific keys
- Rails Admin vs. ActiveAdmin [closed]
- PG::Error: SELECT DISTINCT, ORDER BY expressions must appear in select list
- unable to obtain stable firefox connection in 60 seconds (127.0.0.1:7055)
- Connecting Rails 3.1 with Multiple Databases
- Can we call a Controller’s method from a view (as we call from helper ideally)?
- Rails validation required numericality even though presence is not set to true
- How can I know when to “refresh” my model object in Rails?
- How to get a query string from a URL in Rails
- Rails 3. How to display two decimal places in edit form?
- Is there a Rails Console command (Rails 3+) to reload changed code?
- Rails, Ruby, how to sort an Array?
- How can I replace a hash key with another key?
- Using send_file to download a file from Amazon S3?
- How do you test an AJAX request with RSpec/RoR?
- Upgrading from Rails 3 to Rails 3.1 [closed]
- RSpec any_instance deprecation: how to fix it?
- What does do in rails erb?
- How can I reload the current page in Ruby on Rails?
- Rails 3 – no such file to load — openssl
- In Rails, how to get current URL (but no paths)
- (JSON::ParserError) “{N}: unexpected token at ‘alihack
- What is the best/easy way to validate an email address in Ruby?
- Errno::ECONNREFUSED: Connection refused – connect(2) for action mailer
- Ruby on Rails “invalid byte sequence in UTF-8” due to bot
- I’m getting “found character that cannot start any token while scanning for the next token”
- How to test rendering a partial with RSpec
- Rails: URL/path with parameters
- Listing the names of associated models
- How can I group this array of hashes?
- Rails 3 – Speed up Console Loading Time