The terms you're looking for are "graceful degradation" and "progressive enhancement."
The correct approach is not to make separate views, no. After all, how is your server-side code going to know which view to present? It's really not the server-side code's business whether or not the client has JavaScript enabled. Instead, the correct approach is to create a single view which works in any necessary scenario.
For example, let's say you want to post a form via AJAX and display a message after it's been posted. Clearly you can't do this without JavaScript. So what you would do is create a normal page with a normal form which posts to a server-side action and returns the same page with the message displayed. Then you'd write some JavaScript code to attach to the form's submit event, cancel event propagation, make an AJAX request to a server-side action (perhaps a different action, or perhaps the same one and just parsing the result from the page... though the latter seems like a heavier operation than necessary), and display the message as a result of the response.
This same page will work with or without JavaScript. Those without JavaScript will simply post the form and reload the page. Those with JavaScript will have that functionality "overridden" by the JavaScript code to produce new functionality.
The goal is that all functionality of the application is accessible without any JavaScript. Then JavaScript is used to "inject" its functionality and override the non-JavaScript functionality so that if it's enabled the user has a somewhat better user experience.
How could I display a message saying that user needs to enable javascript if wants to see a specific page?
That seems to entirely conflict with the requirement that "pages should be able to work even if user has javascript disabled." You could use noscript
tags I suppose (I haven't seen those in years, not sure if they were ever technically standard), or even just show the message by default and hide it with JavaScript as the page renders (thus, those with JavaScript wouldn't see it). But either way, that means you would have functionality which requires JavaScript, which is contrary to the requirement.