ref: refs/heads/eula
commit e2510a78f55bed8a0f2d85a45fbf470865ac0f00
Author: J. Daniel Schmidt
Date: Tue Oct 6 18:57:19 2009 +0200
basic functions and views
---
.../app/controllers/registration_controller.rb | 8 ++++++--
plugins/registration/app/models/registration.rb | 11 ++++++++++-
.../app/views/registration/show.html.erb | 2 +-
.../app/views/registration/show.json.erb | 2 +-
.../app/views/registration/show.xml.erb | 2 +-
5 files changed, 19 insertions(+), 6 deletions(-)
diff --git a/plugins/registration/app/controllers/registration_controller.rb b/plugins/registration/app/controllers/registration_controller.rb
index 77f34c6..d610a99 100644
--- a/plugins/registration/app/controllers/registration_controller.rb
+++ b/plugins/registration/app/controllers/registration_controller.rb
@@ -3,15 +3,19 @@
class RegistrationController < ApplicationController
before_filter :login_required
+ @@registration = Registration.new('I am a registered machine (or not)')
-
- def update
+ def update
end
def create
+ # POST to registration => run registration
+
end
def show
+ @registration = @@registration
end
+
end
diff --git a/plugins/registration/app/models/registration.rb b/plugins/registration/app/models/registration.rb
index da97670..1ec7ad1 100644
--- a/plugins/registration/app/models/registration.rb
+++ b/plugins/registration/app/models/registration.rb
@@ -1,8 +1,17 @@
-
# = Registration model
# Provides methods to call the registration in a RESTful environment.
# The main goal is to provide easy access to the registration workflow,
# the caller must interpret the result and maybe call it again with
# changed values.
class Registration
+ @reg = ''
+
+ def initialize(str)
+ @reg = str
+ end
+
+ def to_xml
+ return "<regtest>#{ @reg.to_s }</regtest>"
+ end
+
end
diff --git a/plugins/registration/app/views/registration/show.html.erb b/plugins/registration/app/views/registration/show.html.erb
index 8625c48..e1d4cb3 100644
--- a/plugins/registration/app/views/registration/show.html.erb
+++ b/plugins/registration/app/views/registration/show.html.erb
@@ -1 +1 @@
-<%= @registration.to_xml -%>
+<%= @registration == nil ? "@registration is nil - FIXME" : @registration.to_xml -%>
diff --git a/plugins/registration/app/views/registration/show.json.erb b/plugins/registration/app/views/registration/show.json.erb
index 6214810..277ef41 100644
--- a/plugins/registration/app/views/registration/show.json.erb
+++ b/plugins/registration/app/views/registration/show.json.erb
@@ -1 +1 @@
-<%= @registration.to_json -%>
+<%= @registration == nil ? "@registration is nil - FIXME" : @registration.to_json -%>
diff --git a/plugins/registration/app/views/registration/show.xml.erb b/plugins/registration/app/views/registration/show.xml.erb
index 8625c48..c1a1254 100644
--- a/plugins/registration/app/views/registration/show.xml.erb
+++ b/plugins/registration/app/views/registration/show.xml.erb
@@ -1 +1 @@
-<%= @registration.to_xml -%>
+<%= @registration == nil ? "@registration is nil - FIXME" : @registration.to_xml -%>
--
To unsubscribe, e-mail: yast-commit+unsubscribe@opensuse.org
For additional commands, e-mail: yast-commit+help@opensuse.org