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
0
votes
1 answer

Railscasts, where 'token' variable comes from

The open source project railscasts has User model (link to the full file) class User < ActiveRecord::Base ........ def generate_token if token.blank? # where's definition of this variable? characters = ('a'..'z').to_a +…
megas
  • 21,401
  • 12
  • 79
  • 130
0
votes
1 answer

Tokenfields - undefined method `author_tokens' for #

I am following railscasts tokenfield revised @258 video. Looks like it uses rails 3. While working on it, I got stuck after I setup the has many through association and get the authors ids split by ','. I am using rails 4.2.8…
nekolus
  • 33
  • 6
0
votes
2 answers

Rails polymorphic association link not working

I'm trying to set up a polymorphic association, and I seem to have everything working except this one thing. I'm following along with the railscast here https://www.youtube.com/watch?v=WOFAcbxdWjY and there is a section where he adds a link to a new…
ddonche
  • 1,065
  • 2
  • 11
  • 24
0
votes
1 answer

Rails - Railscasts nested complex forms

I am using Ryan Bates' Complex Forms Deep Branch, and trying to replicate that example for a form that has two additional nested levels. SurveyName has many SurveyQuestions, which have many SurveyOptions. # application_helper (identical to deep…
sscirrus
  • 55,407
  • 41
  • 135
  • 228
0
votes
1 answer

Unable to set owner in Public Activity Gem

I have a social media app, having users along with question/response model in my rails app. I am using pubic activity gem in this application. I have followed the steps as per the railscast. I have also followed this documentation…
Dharmil
  • 63
  • 8
0
votes
1 answer

Validation problems while creating record through file import using Roo gem and following railscast

I am trying to create records through file imports format can be csv excel etc and I have implemented it following the Railscast396. but as I import file it says "Validation failed: Email can't be blank, Password can't be blank. Here is my code …
0
votes
0 answers

Ruby on Rails issues a Nil on Roo::CSV class

I am setting up data import based on RailsCast #396, with validation. I am importing Skills using the skills_import.rb model. The skills_import.rb model is invoked with an actual .csv filename, which should be handled by Roo. But the returned object…
user1185081
  • 1,898
  • 2
  • 21
  • 46
0
votes
1 answer

Railscasts #228 - Sortable Table Columns

I am following Ryan Bates' railscast on Sortable Table Columns and I have successfully gotten a column to sort ascending and descending. My table is more complex than in the Railscast because I have columns from different tables. # controller @cars…
sscirrus
  • 55,407
  • 41
  • 135
  • 228
0
votes
1 answer

Reset Cart after mark_cart_as_purchased

Basically i've been following the RailsCasts Paypal Basic tutorial and after a cart is marked as purchased, you need to reset session[:cart_id] = nil Here's my code class Customer::CartsController < ApplicationController def show @cart = if…
0
votes
1 answer

Advanced search in Rails App - MS SQL Server

I'm getting an error trying to perform a search that was outlined in Railscasts #111 Advanced Search. The code I have at the moment: Searches Controller class SearchesController < ApplicationController def new @search = Search.new end def…
jimps
  • 65
  • 12
0
votes
1 answer

Railscasts: authentication from scratch - missing :session param issue in Rails 4

I'm working through Railscast: authentication from scratch in Rails 4, though the tutorial was built for Rails 3. For this reason, some changes have had to be made from the original tutorial instructions. Tutorial:…
tim_xyz
  • 11,573
  • 17
  • 52
  • 97
0
votes
2 answers

Railscasts196, Rails 4, simple_form, JS, haml

As in Railscasts196, I have nested Attendances in Events, Events in Event_groups: = simple_form_for(@event_group) do |f| = f.error_notification .form-inputs = f.input :name .form-actions = f.button :submit .h2 Events (not simple…
Yshmarov
  • 3,450
  • 1
  • 22
  • 41
0
votes
1 answer

Railscasts Calendar - "undefined method beginning_of_month", Rails 4

I want to be able to print a students homework on a calendar. I followed the railscasts video (revised one) on calendars precisely but I get this error: undefined method `beginning_of_month' for nil:NilClass Code: homeworks_controller.rb ... def…
Co2
  • 343
  • 1
  • 14
0
votes
1 answer

Rails 4 + Stripe + simple_form + Post to server twice

I am working on my RoR4 app to enable users to purchase a subscription using Stripe account. It somewhat works, but the problem is the form got submitted twice, once without a token and then with a token. My application's code is highly inspired…
0
votes
1 answer

How to show activity only to the user whom the post belongs to in Public activity gem

what am trying to do is to use public activity gem to build a notification system i followed this railscast and everything worked just fine. I have a article and a comment model where users can comment on each others article and the user whom the…