[ rails ] controller

@subject = Subject.order(“position ASC”)

== action ==
new, create
edit, update
delete, destory
index (list records)
show (single record)

SubjectsController <- controls Subjects model
URL : subjects/new, subjects/edit

$ rails generate controller Subjects index show new edit delete

generate SubjectsController
also add in routes.rb

Advertisements

Leave a Reply

Fill in your details below or click an icon to log in:

WordPress.com Logo

You are commenting using your WordPress.com account. Log Out / Change )

Twitter picture

You are commenting using your Twitter account. Log Out / Change )

Facebook photo

You are commenting using your Facebook account. Log Out / Change )

Google+ photo

You are commenting using your Google+ account. Log Out / Change )

Connecting to %s