public
Description: blerb running on merb-core
Clone URL: git://github.com/hornbeck/blerb-core.git
fixed settings controller stuff
benburkert (author)
Tue Feb 26 21:39:09 -0800 2008
commit  e99089e40a93cc1f7612d607515c38481bafd339
tree    5f81a4320e00c4b87fb592334b3302ee1c2dccf0
parent  7bb2cd76e8f68ef8c9f37141a84c8d56462eb2bf
...
3
4
5
6
 
7
8
9
10
 
11
12
13
...
3
4
5
 
6
7
8
9
10
11
12
13
14
0
@@ -3,11 +3,12 @@ module Admin
0
     self._layout = 'admin'
0
     
0
     def edit
0
- @setting = Setting.load
0
+ @setting = Setting.instance
0
       render
0
     end
0
   
0
     def update(setting)
0
+ debugger
0
       @setting = Setting.new({"settings" => setting})
0
       @setting.save
0
       redirect url(:edit_settings)
...
1
 
2
3
4
...
 
1
2
3
4
0
@@ -1,4 +1,4 @@
0
-<% form_for(:setting, :action => url(:admin_settings,@setting), :method => :put) do |f| %>
0
+<% form_for(:setting, :action => url(:update_settings), :method => :put) do |f| %>
0
   <fieldset>
0
     <legend>Blerb Settings</legend>
0
     <%= text_control :title, :label => "Blog Title", :class => "title" %>
...
16
17
18
19
 
20
21
22
...
16
17
18
 
19
20
21
22
0
@@ -16,7 +16,7 @@ Merb::Router.prepare do |r|
0
     end
0
 
0
     admin.to(:controller => "settings") do |admin_settings|
0
- admin_settings.match('/settings', :method => :post).to(:action => 'update').name(:update_settings)
0
+ admin_settings.match('/settings', :method => :put).to(:action => 'update').name(:update_settings)
0
       admin_settings.match('/settings').to(:action => 'edit').name(:edit_settings)
0
     end
0
 
...
14
15
16
17
18
 
 
19
20
21
...
14
15
16
 
 
17
18
19
20
21
0
@@ -14,7 +14,7 @@ describe "The settings named routes" do
0
     request_to("/admin/settings", :get).should route_to(Admin::Settings, :edit)
0
   end
0
 
0
- it "should route POST '/admin/settings to Admin::Settings#update" do
0
- request_to("/admin/settings", :post).should route_to(Admin::Settings, :update)
0
+ it "should route PUT '/admin/settings to Admin::Settings#update" do
0
+ request_to("/admin/settings", :put).should route_to(Admin::Settings, :update)
0
   end
0
 end
0
\ No newline at end of file

Comments

    No one has commented yet.