In my rails view(index.html.erb), i have following structure
<div>
<%= render :partial => "create" %>
</div>
<div>
<%= render :partial => "show" %>
</div>
In controller’s create action if i use
def create
render :update do |page|
page.replace_html 'show', :partial => 'show'
end
end
I get below error
undefined method `map' for nil:NilClass
because the instance variable doesnt get initialized from controller
If i use
def create
render :file => "_show.erb"
end
I get template missing error. because the base layout file is not getting rendered.
I basically want to update the partial on create event.
Any suggestions would be of great help.
The solution :layout => false works.
But, newly added entry doesnt come until page refresh
@entry = Model.find(:all)
in the _show.html.erb doesnt get updated
You can try like this it will surely works…………..
but your page should be name like