You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
If everything looks right you should see your directory identical as below. <br><br>
163
163
<ahref="http://tinypic.com?ref=3589c11"target="_blank"><imgsrc="http://i67.tinypic.com/3589c11.png"height="280"width="280"border="0"alt="Image and video hosting by TinyPic"></a>
164
164
165
-
Now that our versioning is complete, let's test out a model and controller to work with our new url of ```localhost:3000/api/v1```. Let's scaffold a test model/controller and call it ```movies```
165
+
Now that our versioning is complete, let's test out a model and controller to work with our new url of ```localhost:3000/api/v1```.
166
+
167
+
2. Let's scaffold a test model/controller and call it ```movies```
166
168
167
169
```ruby
168
170
rails g scaffold Moviesname:string rating:integer
169
171
170
172
rails db:migrate
171
173
```
172
174
173
-
The Rails engine creates your controller in the default ```/controllers``` directory but we need to move our new controller into the ```api/v1``` directory. You can either move it manually or the following:
175
+
The Rails engine creates your controller in the default ```/controllers``` directory but we need to move our new controller into the ```api/v1``` directory.
176
+
177
+
3. You can either move it manually or the following:
Our newly generated controller does not properly inherit from the namespace api/v1 (We will update the routes later in the tutorial) so let's change our controller class from
0 commit comments