Sign in through GitHub

Please read for an updated status on RailsCasts:

Learn more or hide this

pradeep's Profile

GitHub User: pradeepbicc

Comments by pradeep

Avatar

For users in Windows precaution:

ruby
def index 
  @search = Article.search do
    fulltext params[:search]
  end

  @articles = @search.results
end 

This didn't work for me argument (0 for 1) was thrown ...
I had to get around the index action like this..

ruby
def index
  @search = Sunspot.search(Article) do
    fulltext params[:search]
  end

  @articles = @search.results
end
Avatar

I'm using rails 3.0.7 . As I was getting through this awesome cast I couldn't make my url localhost:3000/article/2/comments work:

(No Routes found).

I spend hours trying to find out...later I got the solution ...
in routes.rb file i did:

ruby
resources :articles do
  resources :comments
end

and then only localhost:3000/article/2/comments worked

Avatar

Where does this section of code should be placed.
Does this code adds auth_token to previously existed users ?? Curiousity!

Avatar

Thanks a million Jean! Hit the bulls eye!! Spot on!!

Avatar

has anyone encountered this error going through this tut!!

undefined method `urlsafe_base64' for SecureRandom:Module

app/models/user.rb:39:in generate_token'
app/models/user.rb:31:in
send_password_reset'
app/controllers/password_resets_controller.rb:7:in `create'

because I have and i've no idea how to solve this..

Avatar

thank's a million for this post!! I had spent lot of my time trying to find out what went wrong...U R AN ANGEL helmerj!!!

By the way...what has h() to do with the problem...!! Everything was going fine till the end of tutorial but i was stuck on this last part. Could you please elaborate the h(). I'm kind'a new rider in rails!!
:p eace!!

Avatar

Hi, I have been trying to create a multistep Form (referencing episode #217) and my form has nested attributes as in episode #196.

I have merged the idea from both of these episodes.And I am in problem.
I have two Models.
Models
1) Event has_many: invitations
accepts_nested_attributes_for : invitation,:dependent=>:destroy

2) Invitation belongs_to: event

Controller --Event

ruby
 def new
    @event = Event.new
    2.times {@event.invitations.build}
  end

  def create
    @event = Event.create(params[:event])
     if @event.save
    @event.next_step
    render "new"

View:Event(new)

rails
<%= simple_form_for @event do |e| %>
  <%= render "#{@event.current_step}_step",:e=>e %>
<%end%>

<%= link_to "Back to List", events_path %>

MY PROBLEM :: WHEN I GO TO next_step...the view nor show the nested_field atrributes NOR it shows any error..it simply skips the entire nested form fields....i'm going nuts...how can it simply skip the code!! any idea!!

Avatar

I'm getting the same error. I hope u still remember how did u overcome with this problem...