Reputation: 1090
I don't think I quite understand how rails updates its view pages. I have deleted a piece of code in my index view, and when I go to refresh page, the code is still present. I tried restarting the server, and I can't think what else to do. Must be a simple thing that I haven't learnt yet, as I'm new to rails. Thanks
EDIT:
Routes
projects GET /projects(.:format) projects#index
POST /projects(.:format) projects#create
new_project GET /projects/new(.:format) projects#new
edit_project GET /projects/:id/edit(.:format) projects#edit
project GET /projects/:id(.:format) projects#show
PUT /projects/:id(.:format) projects#update
DELETE /projects/:id(.:format) projects#destroy
search /search(.:format) projects#search
root / projects#index
config/routes.rb:
FinalApp::Application.routes.draw do
resources :projects
match "search" => "projects#search", :as => :search
root :to => 'projects#index'
end
Index action in Project Controller:
def index
@projects = Project.all
respond_to do |format|
format.html # index.html.erb
format.json { render :json => @projects }
end
end
Upvotes: 3
Views: 10331
Reputation: 197
I was doing a tutorial and had run rails server
in the directory outside of app
. I'm pretty sure I stopped and started the server a couple of times, navigated around directories, then I made some changes and they weren't showing. I stopped the server, changed into app
then started the server again, I got what I expected. If you're having trouble, it might be worth checking that.
Upvotes: 0
Reputation: 2252
If it stays the same after editing the html, you are not viewing what you think you are viewing.
Upvotes: 4
Reputation: 436
Make sure that your config/routes.rb
points #index to the right controller and action.
Upvotes: 3
Reputation: 1128
Try deleting the index.html file present in the public folder of your app.
Upvotes: 3