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

How to use private submit to hide from feed?

In the valuations form there is a submit button and a <%= f.submit :private %> button. If private submit is clicked the submitted info will be hidden to other user's who view the profile. How can we also use <%= f.submit :private %> to hide…
user4709022
6
votes
3 answers

How turn off "replace url" in Pjax

I use Pjax with tutorial from http://railscasts.com/episodes/294-playing-with-pjax?view=comments I don't need change url and this coffee script code doesn't work: ..... $("a#flag-comments").click -> .... $.pjax container:…
quatermain
  • 1,442
  • 2
  • 18
  • 33
6
votes
4 answers

Rails Active Admin resource problem

I recently have watched railscast 284 about active admin and wanted to implement it into my web app, however I am running into an issue when I add a resource. I get the following message every time I try to navigate to the created tab: NameError in…
tomciopp
  • 2,602
  • 2
  • 31
  • 60
6
votes
2 answers

Rails : Using jquery tokeninput (railscast #258) to create new entries

I have successfully been able to implement the addition of new artist entries which was not included in Ryan Bates railscast #258 http://railscasts.com/episodes/258-token-fields So in other words, a user can enter an artist name which will…
6
votes
1 answer

has_many returns an array instead of ActiveRecord class

I am following OmniAuth railscasts and trying to implement the same with authlogic + facebook instead of devise + twitter as shown in the railscast. Maybe my understanding of has_many still isn't good but in the railscasts ryan has the following…
Omnipresent
  • 29,434
  • 47
  • 142
  • 186
6
votes
3 answers

Confused about method definition: def req=(request)

I found this in Ryan Bates' railscast site, but not sure how it works. #models/comment.rb def req=(request) self.user_ip = request.remote_ip self.user_agent = request.env['HTTP_USER_AGENT'] self.referrer =…
sent-hil
  • 18,635
  • 16
  • 56
  • 74
6
votes
2 answers

Railscasts Episode #362 - Exporting to Excel: How to avoid the warning message given by Excel 2010 when opening the file?

When using the example app from Ryan Bates' Railscasts Episode #362 about exporting to Excel (https://github.com/railscasts/362-exporting-csv-and-excel), I've noticed that Excel 2010 (which is on Windows) gives me a warning message when opening up…
Rebitzele
  • 3,252
  • 1
  • 20
  • 21
6
votes
1 answer

How to set up the recipient id in public activity

I am going over Public Activity Gem Railscast Vid. (http://railscasts.com/episodes/406-public-activity) My current DB looks/stores everything but the recipient_id....it shows up as nil #
Serge Pedroza
  • 2,160
  • 3
  • 28
  • 41
6
votes
2 answers

Display a Twitter feed from a Rails app

I have been able to have a user sign in with Twitter via OmniAuth (I followed Railscast #235-6 and made a simple application). Now I am trying to display the Twitter feed of the logged in user. Can anyone tell me how this is done? How do I…
katherine
  • 261
  • 4
  • 15
5
votes
5 answers

undefined method `key?' for nil:NilClass

I'm new to Rails and was following Ryan Bate's tutorial on how to make a simple authentication system (http://railscasts.com/episodes/250-authentication-from-scratch?autoplay=true) and I was just going through it but got this error: ` NoMethodError…
5
votes
4 answers

Rails 3 Nested Models unknown attribute Error

I have a model "Issue" and a nested Model "Relationship" In the issue.rb I have mentioned: has_many :relationships, :dependent => :destroy accepts_nested_attributes_for :relationships, :allow_destroy => true In relationship.rb I have…
rgoraya
  • 241
  • 1
  • 3
  • 12
5
votes
2 answers

Nokogiri Segmentation fault?

I am trying to run a simple Ruby script from Railscast and once I run my program I get the following Segmentation fault bug error. I have tried uninstalling and reinstalling Nokogiri and LibXML and still nothing. Is there anyway to fix the Ruby 1.87…
Kevin
  • 625
  • 2
  • 11
  • 19
5
votes
3 answers

Can't understand Ruby's magic

In railscasts project you can see this code: before(:each) do login_as Factory(:user, :admin => true) end The corresponding definition for the function is: Factory.define :user do |f| f.sequence(:github_username) { |n| "foo#{n}" } end I can't…
megas
  • 21,401
  • 12
  • 79
  • 130
5
votes
2 answers

Ruby on Rails escape_javascript usage with jQuery

I have been looking at this Railscast, specifically these lines of code. // views/reviews/create.js.erb $("#new_review").before('
<%= escape_javascript(flash.delete(:notice)) %>
'); $("#reviews_count").html("<%=…
pingu
  • 8,719
  • 12
  • 50
  • 84
5
votes
1 answer

Rails 4 postgres full text search error (scoped)

Ive been following the railscast on full text search with postgres but I keep getting the following error undefined local variable or method `scoped' for # Ive followed the railscast exactly. I have all the correct gems installed. (pg_search, pg).…
Yesthe Cia
  • 528
  • 1
  • 7
  • 20
1
2
3
18 19