Questions tagged [railscasts]

Short Ruby on Rails screencasts containing tips, tricks and tutorials.

Every week Ryan Bates will host a new Railscasts episode featuring tips and tricks with Ruby on Rails. These screencasts are short and focus on one technique so you can quickly move on to applying it to your own project. The topics target the intermediate Rails developer, but beginners and experts will get something out of it as well.

http://railscasts.com/

275 questions
1
vote
0 answers

How can I use an application decorator for site-wide view logic?

After watching the recent Railscasts episode on Draper I thought I'd have a go at refactoring some of my stuff to make use of the Decorator pattern. And then instantly managed to confuse myself. I have view logic in my application layout file that…
DDubyah
  • 53
  • 7
1
vote
0 answers

Javascript code just produces HTML printout, fails to render it

I'm a newbie to RoR and am following this railscast that explains how to remove and add elements within nested forms. In my case, I'm trying to allow users to add/remove "items" from a shopping "list." Unfortunately, however, when I click "add item"…
jyli7
  • 2,731
  • 6
  • 23
  • 31
1
vote
1 answer

Rails 3.1 helper-method to check values of current_user

I've build my own basic blog-tool with Rails 3.1 based upon http://ruby.railstutorial.org/ruby-on-rails-tutorial-book and with the authorization presented in RailsCast 274 ( http://railscasts.com/episodes/274-remember-me-reset-password ). So I have…
1
vote
1 answer

Adding items to a cart redirecting wrong

I've been following this Railscast on implementing Active Merchant in a new test app and it was going well, but now that I'm trying to add what I made to my main app its breaking. When clicking 'add to cart' on my test app, it redirects to the…
Dave
  • 1,175
  • 2
  • 21
  • 49
1
vote
1 answer

Rails: How to link a model to an authenticated user

I want to link a model Tasks to a User properly, to make sure that only an authenticated user can access only the Tasks and dependent models that belong_to User and Task My user model was generated using nifty authentication from Railscasts' Ryan…
ZMorek
  • 679
  • 1
  • 8
  • 24
1
vote
0 answers

Rack Middleware execution railscast

To understand Rack, I was following Railscast video on Rack Middleware and trying out the same thing in my machine. But I'm facing few issues and unable to solve. Firstly, the Rails::Initializer.run is not in my Rails App (I'm using Rails 6), so i…
Learn-ing
  • 21
  • 2
1
vote
1 answer

"Error: \"throw $continue\" is deprecated, use \"return\" instead"

I am following railscast to generate complex form I am receiving this error:- "Error: \"throw $continue\" is deprecated, use \"return\" instead" Any idea? I am receiving this error when I am trying to add a new question.
Mohit Jain
  • 43,139
  • 57
  • 169
  • 274
1
vote
0 answers

Railscast geocoding missing JSON::ParserError constant

Replicating the geocoding example from Railscast #273 at http://railscasts.com/episodes/273-geocoder under Rails 3.1rc4 using: multi_json (1.0.3) nifty-generators (0.4.6) I get NameError in LocationsController#create uninitialized constant…
marc meyer
  • 530
  • 6
  • 6
1
vote
2 answers

Edit multiple records, controller & routing

I am following railscast 198 http://railscasts.com/episodes/198-edit-multiple-individually, trying to update it to rails 3, and am stuck with a routing error. The route http://localhost:3000/orders/edit_individual gives me the…
thejonster
  • 156
  • 2
  • 10
1
vote
0 answers

Rails 3: jquery_tokininput railcast #258 - how to add new entries?

Hi I've followed ryan bates railscast on the jquery_tokeninput gem and I've gotten everything working on my app except the ability to create new entries. From the show comments it looks like an issue was started and people have been able to figure…
trying_hal9000
  • 4,343
  • 8
  • 43
  • 62
1
vote
5 answers

Rails Cast: ActionMailer Email not sent to inbox

The server states that the email was sent to the correct address but I am not getting the message in my inbox. My Setup_mail.rb file ActionMailer::Base.smtp_settings ={ :address => "smtp.gmail.com", :port => 587, :domain …
Skilatte
  • 25
  • 1
  • 6
1
vote
4 answers

Writing a search method that matches loosely

I have just watched the railscast about a simple search form and I want to do something like that in my app, but I don't want to find just results that match exactly. I have a model named Project with the following fields: name, description,…
Samth
  • 113
  • 1
  • 1
  • 5
1
vote
1 answer

Rails Validating on a virtual attribute, setting form error. Railscast #32

I'm basically attempting to implement the solution from Railscast #32, modernized for Rails 3.0.7 http://railscasts.com/episodes/32-time-in-text-field class Task < ActiveRecord::Base attr_accessible :description, :complete, :deadline validate…
1
vote
1 answer

Railscasts #258 jQuery Tokeninput - What about having a form with 4 or 5 tag searchable inputs?

Is it possible to use the method in Ryan Bates recent screencast to create multiple jquery tokeninput form boxes within 1 single form? http://asciicasts.com/episodes/258-token-fields If you setup 5 different models with a has_many relationship to…
trying_hal9000
  • 4,343
  • 8
  • 43
  • 62
1
vote
1 answer

How to create a model through text field with validation?

I followed the tutorial "Create a model through text field" (Railscast #57) which works so far. Though, I noticed that neither the select field nor the input field for the new object get validated. I am using accepts_nested_attributes_for and…
JJD
  • 50,076
  • 60
  • 203
  • 339