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

Problem with Railscast #197 - Nested Model Form Part 2

I'm trying to implement Ryan's Railscast #197 in a system with Questions, Answers, and (multiple choice) Options. http://railscasts.com/episodes/197-nested-model-form-part-2. I have successfully implemented the nesting among these…
sscirrus
  • 55,407
  • 41
  • 135
  • 228
3
votes
1 answer

Issue of deleting record in Nested Model Form Rails 4

I am following RailsCast # 196 Nested Model Form Part 1. I have given the same name of controllers as well as model and it's all attributes. But now when I try to go in edit and remove the question. It doesn't delete the question if I select the…
Hetal Khunti
  • 787
  • 1
  • 9
  • 23
3
votes
1 answer

Rails - fields_for and javascript to dynamically add and remove fields in a form (railscasts ep. 196-197)

UPDATE Thank you for your answer. But If I remove for requested_role in @project.requested_roles from the partial, then I can't access to the requested_role.role value, because I don't have the parameter X obtained from the code for X in…
Dario Carbone
  • 33
  • 1
  • 4
3
votes
1 answer

Using AJAX to search, sort, and paginate in Rails 4

I'm trying to do a real-time search in a Rails 4.0.1 application. I used the Railscasts #240 tutorial, but I am not getting the same results as the cast. It seems that my only issue is with the AJAX script, but I don't know why or…
3
votes
1 answer

Using jCrop with cloudinary through rails 4 to crop before creating image

I've been at this for some time now. I"m using cloudinary to upload photos and am trying to implement a cropping feature using jcrop on a photo create action. After I implemented cloudinary I followed railscasts #182 on Jcrop. I think I'm having…
monty_lennie
  • 2,871
  • 2
  • 29
  • 49
3
votes
2 answers

Nested Model Forms - Railscast #196 revised - Adding fields via jQuery not working

I was following the Railscast #196 revised and everything went basically fine, but I am not able to add new fields to the nested form. The "remove fields" function works nicely, but after click on "link_to_add_fields", the browser jumps to the top…
YvonC
  • 329
  • 2
  • 6
  • 22
3
votes
1 answer

Unpermitted parameters for Dynamic Forms in Rails 4

I'm new to Rails and built something based on this http://railscasts.com/episodes/403-dynamic-forms but I have a problem with storing data in the additional fields... I have a ProductType object that has many ProductField objects. The ProductField…
AntonyZ
  • 43
  • 1
  • 4
3
votes
1 answer

adding nested fields dynamically with parent.send(association).build instead of reflect_on_association(association).klass.new

I'm using simple_form's fields_for and add fields dynamically with the link_to_add_fields method proposed by Ryan Bates (Railscast). The Problem I have is that f.object.class.reflect_on_association(association).klass.new , which is used to…
3
votes
2 answers

Adding Prefix Match to pg_search

I am following this Railscasts episode. If I search "Kerber" it does return the right article. But if I search "Ke" it does not returns the same article. There's a way to fix this? class Item < ActiveRecord::Base include PgSearch …
Sullivan
  • 55
  • 6
3
votes
2 answers

Setting up Linode (Ubuntu 10.04 32bit) nginx not starting. 98: address already in use

Hello having a little issue with setting up linode via Railscast instructions of Ep. #335 My Configuration for this server is: Ubuntu 10.04 LTS Disk Image 32bit I can get this far: Running both of these work as expected. apt-get -y update apt-get -y…
samuelkobe
  • 546
  • 4
  • 16
3
votes
2 answers

Gettin 500 Internal Server Error in rails on ajax request

I'm trying to create a record from a form. I've used railscast 136 as ground work. When I trying to submit I get a 500 error for missing partial. I've created the controller correlated javascript view but it is requesting a view with the same name…
Petter
  • 130
  • 1
  • 1
  • 11
3
votes
1 answer

jQuery does not update nested form in Rails

I'm following Railcasts 197 in order to make a nested form to my application. What I'm trying to do is displaying a "remove" link which hides a row from the form using jQuery. If I click in remove, nothing happens, but if I hit Submit and there are…
Eduardo Copat
  • 4,941
  • 5
  • 23
  • 40
3
votes
3 answers

Rbenv stopped working after Capistranos `cap deploy:cold` - fails RailsCast episode 335

I'm following rails Cast episode 335: http://railscasts.com/episodes/335-deploying-to-a-vps using a linode VPN, running: cap deploy:cold * executing `deploy:cold' * executing `deploy:update' ** transaction: start * executing…
Benamir
  • 1,107
  • 2
  • 11
  • 24
2
votes
1 answer

Dynamic attr_accessible in rails

According to the rails-cast #237, dynamic attributes were to be easily implemented. Although I have run into some errors when trying to create an object in the rails console. Please advise. The error I am getting is as follows : ruby-1.9.3-p0 :005 >…
Jason Waldrip
  • 5,038
  • 8
  • 36
  • 59
2
votes
2 answers

Getting undefined method `klass' for nil:nilclass - Railscast #197

Hi all I followed Ryan Bates' railscasts on nested models and form, but I am getting getting undefined method `klass' for nil:nilclass. I am pretty sure it is due to the the link_to_add_fields since everything was working prior. Below is my error…
Pan Wangperawong
  • 1,250
  • 2
  • 13
  • 29