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

rack::offline in rails 4.1 Issue

can someone give me a quick solution please? I have done this: My routes: offline = Rack::Offline.configure do cache ActionController::Base.helpers.asset_path("application.css") cache…
ben
  • 6,000
  • 5
  • 35
  • 42
0
votes
1 answer

Ajax url still changing

I've been following RailsCasts #240 on adding ajax to my view. Essentially, the problem that I'm running across right now, is that the url is still changing when I sort the table column or go to the next page of the index. I've followed the rails…
user3785435
0
votes
2 answers

rails endless scroll with kaminari, event not triggering

Fallowed the endless scrolling tutorial by Ryan Bates, and don't understand why it's not working ;/ partial does not update localfeeds/show.html.erb
0
votes
0 answers

Ruby On Rails - Use .html request format if .mobile file doesn't exist

I followed http://railscasts.com/episodes/199-mobile-devices and implemented request.format = :mobile if mobile_device? But it's pretty stupid and sometimes confusing if I just need to copy the same html in the .mobile files. Is there any way to…
hansottowirtz
  • 664
  • 1
  • 6
  • 16
0
votes
1 answer

Multitenant app - undefined method users for current_tenant.users

I am following Ryan Bate's Multitenancy with Scopes tutorial (http://railscasts.com/episodes/388-multitenancy-with-scopes) and I ran into the following error when I attempted to scope my users to the correct tenant: undefined method users for…
Huy
  • 10,806
  • 13
  • 55
  • 99
0
votes
1 answer

Nested Model Form with required fields does not Save

I have a nested model form with parent Foo and child Bar. I followed http://railscasts.com/episodes/196-nested-model-form-revised through getting this setup for me. It was worked great. I can add and delete Bars easily, through javascript (per the…
Ervin E
  • 442
  • 5
  • 18
0
votes
2 answers

Rails model design decision - trying to avoid creation of mutliple new models using HABTM x 2

I've been following the HABTM Railscast and am looking to extend it. The Railscast way is great for adding categories to a product. But lets say I have (say) 5 ways of categorising products along different dimensions (and these change…
0
votes
1 answer

Railscast #383 add/remove uploader form and script via AJAX

I've got the uploader working from the Railscast #383, but is there a way to add and remove the uploader link via ajax? I would also need to pass in the "service" instance id. The code I would like to add or remove via ajax is below: <%=…
tquill
  • 279
  • 2
  • 12
0
votes
1 answer

Why my Javascript is only picking the first If Else arugemnt?

I'm using Ryan Bates gem to create notification of my app for comments, the comments are polymorphic to the Posts that are created, BEFORE going into the details, here is the Javascript that picks the first argument no matter what the values are, I…
0bserver07
  • 3,390
  • 1
  • 28
  • 56
0
votes
1 answer

No route matches POST when updating rails-api gem

When I add this to my gem file ( rails 4.0.1 ) gem 'rails-api', git: 'https://github.com/rails-api/rails-api.git', branch: 'master' My routes seem to break (although rake routes is the same before/after) I get this after I attempt to update a…
MikeW
  • 4,749
  • 9
  • 42
  • 83
0
votes
1 answer

Rails 4 StrongAttributes in RailsCast #274

I am new to Rails. Particularly in dealing with the vagaries between Rails 3 and 4. I have been learning from RailsCast and MHartl's tutorial. I successfully got the code in RailsCast #274 to work by using the answer in the question linked…
Puchembo
  • 5
  • 5
0
votes
1 answer

NoMethodError within nested model form

The project is a simple workout creator where you can add exercises to a workout plan. I've been following the Railscast covering nested model forms to allow dynamically adding and deleting exercises, but have run into an error and need a second…
0
votes
1 answer

Rails - Simple Search from Railscast Not Displaying

i've been following the railscast tutorial on how to create a simple search form, for some odd reason, whenever I search the URL changes and the server log shows that it searches for the post, in this case an ad, but it doesnt display it. My Ad…
0
votes
0 answers

Ordering polling requests

I am trying to follow rails casts episode #228 on polling for changes. I am essentially following the screencast word for word, except that I am using it for notifications instead of comments. The only difference is that every time he uses the…
Philip7899
  • 4,599
  • 4
  • 55
  • 114
0
votes
1 answer

Using presenters (Ryan Bates' style) without an associated model

I would like to use presenters (as seen here: http://railscasts.com/episodes/287-presenters-from-scratch?view=asciicast) to clean up my static_pages views, but his method seems to rely on an underlying model, which static_pages does not have. Can I…
jackerman09
  • 2,492
  • 5
  • 29
  • 46