I have been trying to get to grips with jQuery and been following a [railscast](http://railscasts.com/episodes/136-jquery) on adding an Ajax add review form, which works fine but I would now like to add into it the ability for a review to belong to a user as well as a venue. 

**Reviews controller**

```
def create
    @review = Review.create!(params[:review])
    @review.venue = @venue
    if @review.save
      flash[:notice] = 'Thank you for reviewing this venue!'
      respond_to do |format|
        format.html { redirect_to venue_path(@venue) }
        format.js
      end
    else
      render :action => :new
    end
  end

```

**views\reviews\create.js.erb**

```
$("#new_review").before('<div id="flash_notice"><%= escape_javascript(flash.delete(:notice)) %></div>');
$("#reviews_count").html("<%= pluralize(@review.venue.reviews.count, 'Review') %>");
$("#reviews").append("<%= escape_javascript(render(:partial => @review)) %>");
$("#new_review")[0].reset();

```

I have tried changing the controller to:

```
  def create
    @review = @current_user.reviews.create!(params[:review])
    @review.venue = @venue
    if @review.save
      flash[:notice] = 'Thank you for reviewing this venue!'
      respond_to do |format|
        format.html { redirect_to venue_path(@venue) }
        format.js
      end
    else
      render :action => :new
    end
  end

```

but it just wont submit, with no errors.

I think I have the models set correctly with belongs\_to and has\_many, I think this is a controller issue I'll add other code bits if needed.

**Development log**

```
NoMethodError (undefined method `reviews' for nil:NilClass):
  app/controllers/reviews_controller.rb:14:in `create'

```

Thanks for any help!