Class: RemotesPage

Inherits:
RecordProxyPage
  • Object
show all
Defined in:
lib/models/remotes_page.rb

Instance Method Summary collapse

Instance Method Details

#form_for_new_record(options = {}, &block) ⇒ Object



16
17
18
# File 'lib/models/remotes_page.rb', line 16

def form_for_new_record(options={}, &block)
  form_for(Remote.new, options, &block)
end

#new_recordObject



12
13
14
# File 'lib/models/remotes_page.rb', line 12

def new_record
  Remote.new
end

#recordObject

record proxy pages deal with site models (site.model_name). Override the methods it uses to interact with these models we can edit Remotes (a non site model)



4
5
6
# File 'lib/models/remotes_page.rb', line 4

def record
  @record ||= Remote.find(BSON::ObjectId.from_string(params['id']))
end

#recordsObject



8
9
10
# File 'lib/models/remotes_page.rb', line 8

def records
  @records ||= Remote.all
end