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

How to ensure only specific attributes are updated and force another attribute to be nil in Rails?

In RailsCasts Episode #274 'Remember Me & Reset Password', the user enters their new password which submits to the PasswordResetsController. The cast shows the line that updates the attributes to be: elsif @user.update_attributes(params[:user]) for…
Turgs
  • 1,729
  • 1
  • 20
  • 49
0
votes
1 answer

skipping client side validations

i have just finished watchin Ryan Bates RailsCast on multi steps form. Its great and all, but as you can see here Ryan is using two submit buttons, one for continue and saving the model, and the other one, "back button" for going back to the…
Leo
  • 2,061
  • 4
  • 30
  • 58
0
votes
1 answer

Add Ratings and Comments in the same Controller

I have gotten a comment model to work based on railscast 238 but I would like to add voting and rating as well. My current show for the article controller is: def show @article = Article.find(params[:id]) @commentable = @article …
0
votes
1 answer

What's the proper way to display data scraped via Nokogiri?

In my application I have a field where users can enter a URL and then products will be scraped from that URL. I watched "Screen Scraping with Nokogiri", and I created the result I wanted; I put in a URL and the data gets mined. How do I implement…
Kwestion
  • 464
  • 5
  • 19
0
votes
2 answers

saving to two different models - accepts_nested_attributes_for not working

EDITED: code below reflects last suggestions from your answers... I'm having trouble with saving to two different models, from one form... I tried to follow rails casts #196 and looked at several other examples here at stackoverflow but I haven't…
lbramos
  • 327
  • 1
  • 6
  • 19
0
votes
2 answers

Railscasts #396 not working for importing Excel sheet

I used the Railscasts to create a feature for uploading CSV and Excel files. Importing CSV files is working well, but when I use Ryan's code for importing Excel sheets using the Roo gem, it throws an error: TypeError in…
marcacyr
  • 405
  • 4
  • 15
0
votes
1 answer

Create an approval form that lists all unapproved samples and allows to edit/approve them

I have a model called sample. To simplify, "sample" will have a "name", "price" and "approved" fields. I want to have a page that will list all samples that have "approved = 'false'". In this page I want to be able to edit the sample fields, check…
lbramos
  • 327
  • 1
  • 6
  • 19
0
votes
0 answers

Nested Models with Comments

I have an application where there are a few nested models... Two parent models and two child models. I'm trying to create comments on the child models and I had it working great for the first one until I realized I have to create comments on the…
0
votes
1 answer

Public_Activity returning an object instead of result

I installed the public_activity gem following the railscasts tutorial. The activities page in the browser is returning an object instead of the actual event that the activity is referring to. class ActivitiesController < ApplicationController def…
Alex Cowley
  • 123
  • 4
  • 11
0
votes
1 answer

Rails Make a Birthday Calendar

I would like to make a birthday calendar based on the example in Railscast #213 (Revised) for our members for each month. Each member has a birth_date and has_many memberships at different locations. To solve the problem, I thought I would make a…
JHo
  • 1,068
  • 1
  • 14
  • 29
0
votes
1 answer

Carrierwave uploads don't appear on POST

I'm following the Railscast tutorial for Carrierwave uploads, and have the same files set up. An upload works fine if I upload a file via the console, but my form doesn't seem to post correctly. I've got my basic form, which includes: <%= f.label…
0
votes
1 answer

Using Ajax to replace a div with a partial in Rails

I'm following Ryan Bates' Railscast #136 and trying to use AJAX to replace a div ('#inviteform1') with a partial ('thankyou') after a form submission. For some reason, when the form is submitted, it's not working -- instead a blank screen appears,…
nishacodes
  • 197
  • 1
  • 9
0
votes
1 answer

Railcasts: #241 Simple Omniauth, routing error for "/auth/twitter"

Hi I am following Railcasts: #241 Simple Omniauth tutorial so I can let users log in to my sample application using the omniauth-twitter gem, however I am getting a routing error when entering the /auth/twitter stage of tutorial. What I have added…
0
votes
1 answer

Railscasts Not Working - 147 and 302

I tried implementing the features in RailsCast 147 Sortable Lists and 302 In-Place Editing, but after having followed every step along the way, the effects that showed on Ryan's screen was different from mine. In the case of 302 In-Place Editing,…
jytoronto
  • 558
  • 3
  • 10
  • 18
0
votes
1 answer

Rails Iteration by month given range of dates

I'm trying to follow this Railscast and create a morris.js line chart for my Enquiry model. I've grouped the counts using date_trunc into months, but now I'm not quite sure at how to get the X-axis to iterate over months (e.g Jun 2012, Jul 2013) as…
Ryan.lay
  • 1,741
  • 2
  • 17
  • 30