pvskisteak5
pvskisteak5

Reputation: 4262

link_to links not working in other views after using devise

I'm working on a rails app that uses devise.

I added other models to the app and the links in those new views (default "link_to") are not working. For example, I scaffolded a new model and the links for those views do not change the URL (hard coding in the actual url in the address bar works fine and renders the correct view - the actions even work when adding, editing, deleting data).

I've checked my link_to code - they are set up correctly. Even linking to another site like google.com does not work. When hovering over the link, the correct url shows in the bottom left of the screen, but it does not change the address bar url after clicking.

Does anyone have any idea what may be causing this? It is driving me crazy! Any help is much appreciated!

EDIT: adding some code for illustrate:

link_to example from navigation partial under layouts:

<%= link_to 'Home', root_path %>

routes.rb:

Example::Application.routes.draw do

resources :topics

resources :tutorials

resources :packages

get "/index" => "home#index", :as=>"index"

authenticated :user do
 root :to => 'home#index'
end

devise_scope :user do
 root :to => "home#index"
end

devise_for :users, :controllers => { :registrations => "registrations" }

resources :users do
 get 'invite', :on => :member
end

end

Upvotes: 1

Views: 296

Answers (1)

pvskisteak5
pvskisteak5

Reputation: 4262

Thanks for the guidance sanny Sin - upvoted your comment.

Problem was with pagescroller js - had to add an if statement to the application layout to use the js if current_page was home#index, otherwise do not use the script.

Upvotes: 1

Related Questions