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
5
votes
2 answers

Issue with railscast# 238 , date_select not working with rails 4.

I am trying railscast#238. I am using rails 4 and mongoid(4.0.0).When trying to add published_on field with date_select helper. It is not able to save into collection. Then, I added :published_on in the permit function. But then also I am getting…
5
votes
4 answers

undefined method `admin?' for nil:NilClass

I followed railscast #250 Authentication from Scratch & got everthing wworking fine. Now I'm trying to only display edit & destroy links on my index page to admin user's. I've set up mu User database with a admin boolean field & tried putting a…
Holly
  • 7,462
  • 23
  • 86
  • 140
5
votes
4 answers

Can't get rails search form to work with simple_form and sunspot

I have a simple rails app that uses the simple_form gem for forms and I am trying to set up a search form using sunspot. I have followed the instructions in Ryan Bates' railscast on setting up sunspot and it works fine except for the fact that I…
Josh Frank
  • 95
  • 2
  • 7
4
votes
2 answers

Ruby map method syntax question

Possible Duplicate: What does map(&:name) mean in Ruby? I was watching railscasts more virtual attributes episode. In that episode, at one point, ryan used a map method syntax which I am not able to understand, Could someone please explain…
felix
  • 11,304
  • 13
  • 69
  • 95
4
votes
2 answers

Rails 4 Carrierwave + Minimagick: Failed to manipulate with MiniMagick, maybe it is not an image? Original Error: `mogrify -crop

Been researching around but fail to pinpoint the problem: I am following Railscasts PRO #182 on cropping images using JCrop, Carrierwave and Minimagick. As I come to recreating image versions I am prompted the error: CarrierWave::ProcessingError…
4
votes
1 answer

Private messages with Faye and Rails

I'm using the faye gem menitioned in the railscast allowing apps to push messages. Problem is it pushes messages to all chat clients that are open. I need them to be private. It's possible to get private messaging with faye but it's url based. For…
Alain Goldman
  • 2,896
  • 5
  • 43
  • 75
4
votes
1 answer

Using Active Record Reputation System gem, no sorting happens when I sort by votes

Following the RailsCast for the reputation system gem, I added the following code to my microposts_controller def index @microposts = Micropost.paginate(page: params[:page]).find_with_reputation(:votes, :all, order: "votes desc") @micropost =…
4
votes
1 answer

How does the method .call() work?

I'm implementing authorization in an app according to this Railscasts episode. In one of the instance methods, Ryan Bates is using the method .call and I don't understand what exactly it is doing. This is the code for the whole model. And this is…
Fellow Stranger
  • 32,129
  • 35
  • 168
  • 232
4
votes
1 answer

Rails : User logged out after destroying an unrelated object with :remote => true

I'm following http://railscasts.com/episodes/250-authentication-from-scratch for simple authentication. It works as expected. I have a model in my app with the following partial : <%= content_tag_for(:li, post) do %> <%= link_to 'Delete', post,…
brayne
  • 1,355
  • 2
  • 16
  • 27
4
votes
2 answers

Stripe: error messages when Creating a Customer &/or Charge - Ruby on Rails

I am implementing Stripe in my Rails app & get an Invalid Token error when I load the entry form - I haven't submitted customer data yet. I mostly followed the http://railscasts.com/episodes/288-billing-with-stripe tutorial. I made a few…
ThinQtv
  • 103
  • 1
  • 1
  • 11
4
votes
3 answers

rails excel mime-type - how to change default filename?

I followed the http://railscasts.com/episodes/362-exporting-csv-and-excel and set up an Excel Download in my Rails application. My controller code looks like this: def show @project = Project.find(params[:id]) @project.tasks.order(:name) …
tmaximini
  • 8,403
  • 6
  • 47
  • 69
4
votes
3 answers

RailsCast 182 (revised): Jcrop not working

I am trying to use Carrierwave with Jcrop in the exact same way as Ryan Bates uses it in RailsCasts Episode 182 (revised) but I just can't get Jcrop to work and I can't figure out why. When I get to crop.html.erb, it shows the original picture and…
fjahr
  • 449
  • 5
  • 25
3
votes
2 answers

private pub - publish from controller never works

Trying to implement a simple notification system based on private pub ( something like juggernaut ). by Ryan bates see: http://railscasts.com/episodes/316-private-pub Problem: Im unable to send a message true private pub from a controller Some…
Rubytastic
  • 15,001
  • 18
  • 87
  • 175
3
votes
2 answers

Using jquery TokenInput without default 'name'

Im trying to use the jquery tokeninput found here: http://loopj.com/jquery-tokeninput/ Following the guide from railcasts: http://railscasts.com/episodes/258-token-fields By default, it required a 'name' column on the table/json.. Any way to…
Jonah Katz
  • 5,230
  • 16
  • 67
  • 90
3
votes
1 answer

putting has_many :through into play and using it in an actual form

class Allowedevent < ActiveRecord::Base :belongs_to :room :belongs_to :event end class Room < ActiveRecord::Base :has_many :allowedevents :has_many :events => :through => allowedevents end class Event< ActiveRecord::Base …
Tobi
  • 31
  • 1
1 2
3
18 19