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

RoR: how can I search only microposts with a specific attribute?

Right now in app/views/microposts/home.html.erb I have.. <% form_tag purchases_path, :method => 'get', :id => "products_search" do %>

<%= text_field_tag :search, params[:search] %> <%= submit_tag "Search", :name => nil %>

<% end…
BigBoy1337
  • 4,735
  • 16
  • 70
  • 138
0
votes
1 answer

Syntax Error ruby on rails unexpected ':', expecting '}' when calling render json:

Error: SyntaxError in UsersController#index /home/ubuntu/ruby/users/app/controllers/users_controller.rb:7: syntax error, unexpected ':', expecting '}' format.json{render json: UsersDatatable.new(view_context)} …
StanM
  • 827
  • 4
  • 12
  • 33
0
votes
1 answer

Converting an array of data-objects to raw data

This is probably a huge oversight on my part, but I have been searching for a fix for about an hour now, with no luck! I am following the RailsCast tutorial on exporting data to .CSV The data I am using to populate the CSV is coming from a Ransack…
briankulp
  • 186
  • 1
  • 11
0
votes
1 answer

Reputation system from scratch. Limit number of current_user votes to 1

in this screencast Ryan Bates showed how to implement reputation system from scratch. But is there any way to give the current_user only 1 vote, and check whether user has already voted for application, and if yes, restrict the possibility of…
Ilya Cherevkov
  • 1,743
  • 2
  • 17
  • 47
0
votes
1 answer

rails not updating page title

I am following railscasts to update custom page title and realized that it doesn't work anymore. So, i updated the code as follows based on the comments. I see 'My Services -' if i do not set the title, whereas i expect it to contain default title…
Kiran
  • 5,478
  • 13
  • 56
  • 84
0
votes
1 answer

How to add params[:controller] in params[:comments] record?

Good day. How to add params[:controller] value in params[:comments]. (in View) I want the comment Model will be filled with following parameters: #comment.rb id: text: commentable_id: user_id: controller: #for example 'posts', or 'galleries' But…
0
votes
1 answer

Setting up Omniauth Identity to connect with Existing User Model

I was going through this Railscast to setup Omniauth Identity, but I was unclear about one part. He creates a new Model called Identity which then holds the email, name and password fields. However, I already have a user model with those fields, so…
am-rails
  • 1,463
  • 2
  • 16
  • 40
0
votes
2 answers

Whenever a User object is created, create Profile object too with devise and omniauth

I followed Ryan Bates #235 Devise and OmniAuth (revised) http://railscasts.com/episodes/235-devise-and-omniauth-revised and was able to make it work. Now, I would like to add a Profile to the User. So, I tried this... def self.from_omniauth(auth) …
Fred Guth
  • 1,537
  • 1
  • 15
  • 27
0
votes
1 answer

Cant get simple search work in Rails

I am a rails newbie. I am trying to implement simple search in my Tweets but it displays the entire tweets that are there and not the particular tweet I am searching for. Using SQLITE and Rails 3.2.6 I looked at RailsCasts#37 and bunch of other…
gkolan
  • 1,571
  • 2
  • 20
  • 37
0
votes
0 answers

Using Ajax to add fields in nested model forms

I followed the instructions on RailsCasts to setup a Nested Model Form. (This lets you have multiple models within one form.) The initial code did not work until I added code to controller new method to build the nested-models (see below). The…
am-rails
  • 1,463
  • 2
  • 16
  • 40
0
votes
1 answer

Rails Merge params with select

I was just looking at Ryan Bates railscast tutorial on Sortable Table Columns which with a few modifications becomes ajaxified in one of his later videos(Search, Sort, Paginate with AJAX). I think his solution worked great, it's clean and it…
Noz
  • 6,216
  • 3
  • 47
  • 82
0
votes
3 answers

Rails 3.2.6: Getting 'Unable to access log file' error for development.log file

This seems like it would be a common problem, but I just can't seem to find the solution through google searches, etc. I just created a new Rails 3.2.6 application and configured it to use the PostgreSQL database for my local development. I…
richsinn
  • 1,341
  • 1
  • 12
  • 27
0
votes
1 answer

Endless scrolling not working

I'm following along with Ryan Bates' http://railscasts.com/episodes/114-endless-page-revised. The initial alert box, he demonstrates, that appears after scrolling to the bottom works fine, but I'm unable to get anything after that to work…
Tony Beninate
  • 1,926
  • 1
  • 24
  • 44
0
votes
1 answer

Facebook Graph API only returning 50 comments

I'm using the koala gem as show in Railscasts episode #361. I'm attempting to get all of the comments of a given Post but Facebook only seems to be giving me back the last 50 comments on the post. Is this a limitation of Facebook's Graph API or am I…
Kyle Decot
  • 20,715
  • 39
  • 142
  • 263
0
votes
2 answers

Rails 3 railscast #196, 3.times loop not working

I have found a lot of posts about this Railscast but all the suggestions haven't helped me. I have been able to render in the view a nested form field, but only one, not the 3 that I have called out in my controller. When I submit, I get the error:…
HappaGirl
  • 117
  • 1
  • 10
1 2 3
18
19