From his2000x at gmail.com Wed Apr 1 13:22:51 2009 From: his2000x at gmail.com (in-seok hwang) Date: Thu, 2 Apr 2009 02:22:51 +0900 Subject: hi! plz teach me! about file upload Message-ID: hi all! i can't speak english well.. i want know that file upload... Search has a lot of time. i can find just one Example this link.. http://www.oreillynet.com/ruby/blog/2007/01/the_joy_of_rolling_your_own_wi_1.html And it was typed. but, error occurs. error code(Fold) is... Camping Problem!Conf::Controllers::Upload.POSTNoMethodError undefined method > `Tempfile' for "glasses.pdf":String: > > - conf_mongrel.rb:224:in `post' > - (eval):27:in `send' > - (eval):27:in `service' > - (eval):46:in `run' > - /usr/local/lib/site_ruby/1.8/mongrel/camping.rb:53:in `process' > - /usr/local/lib/site_ruby/1.8/mongrel/camping.rb:52:in `synchronize' > - /usr/local/lib/site_ruby/1.8/mongrel/camping.rb:52:in `process' > - /usr/local/lib/site_ruby/1.8/mongrel.rb:159:in `process_client' > > why can't find method? my code has this line require 'tempfile' i can't understand.... and second question is .... What is the way typical file upload in camping? i want example code.... Curious does not sleep. plz teach me. thank you for reading my article.. have a nice day... -------------- next part -------------- An HTML attachment was scrubbed... URL: From blueberry at creativepony.com Wed Apr 1 17:43:47 2009 From: blueberry at creativepony.com (Jenna Fox) Date: Thu, 2 Apr 2009 08:43:47 +1100 Subject: hi! plz teach me! about file upload In-Reply-To: References: Message-ID: <6C908BC7-332B-4766-9874-F3FAEA05BF77@creativepony.com> In the current version of Camping, we use Rack. Rack has a slightly different upload system. To read the contents of an uploaded file, where the upload was done using you must now do: input.upload[:tempfile].read This also applies to file uploads done using Adobe Flash. :) ? Jenna On 02/04/2009, at 4:22 AM, in-seok hwang wrote: > hi all! > > i can't speak english well.. > > i want know that file upload... > > Search has a lot of time. > > i can find just one Example > > this link.. > > http://www.oreillynet.com/ruby/blog/2007/01/the_joy_of_rolling_your_own_wi_1.html > > And it was typed. > > but, error occurs. > > error code(Fold) is... > > Camping Problem! > > Conf::Controllers::Upload.POST > > NoMethodError undefined method `Tempfile' for "glasses.pdf":String: > > conf_mongrel.rb:224:in `post' > (eval):27:in `send' > (eval):27:in `service' > (eval):46:in `run' > /usr/local/lib/site_ruby/1.8/mongrel/camping.rb:53:in `process' > /usr/local/lib/site_ruby/1.8/mongrel/camping.rb:52:in `synchronize' > /usr/local/lib/site_ruby/1.8/mongrel/camping.rb:52:in `process' > /usr/local/lib/site_ruby/1.8/mongrel.rb:159:in `process_client' > > why can't find method? > > my code has this line > require 'tempfile' > > i can't understand.... > > and second question is .... > > What is the way typical file upload in camping? > > i want example code.... > > Curious does not sleep. > > plz teach me. > > thank you for reading my article.. > > have a nice day... > > > _______________________________________________ > Camping-list mailing list > Camping-list at rubyforge.org > http://rubyforge.org/mailman/listinfo/camping-list -------------- next part -------------- An HTML attachment was scrubbed... URL: From his2000x at gmail.com Wed Apr 1 19:44:11 2009 From: his2000x at gmail.com (in-seok hwang) Date: Thu, 2 Apr 2009 08:44:11 +0900 Subject: hi! plz teach me! about file upload In-Reply-To: <6C908BC7-332B-4766-9874-F3FAEA05BF77@creativepony.com> References: <6C908BC7-332B-4766-9874-F3FAEA05BF77@creativepony.com> Message-ID: oh... sorry. i can't use current version. I had a lot of code writing. i used 1.5.180 camping version. when i upgrade to the latest version is a lot of errors. but, I want to use the latest version. Anyway, how do upload file in 1.5.180 2009/4/2 Jenna Fox > In the current version of Camping, we use Rack. Rack has a slightly > different upload system. > To read the contents of an uploaded file, where the upload was done using > you must now do: > > input.upload[:tempfile].read > > This also applies to file uploads done using Adobe Flash. :) > > ? > Jenna > > On 02/04/2009, at 4:22 AM, in-seok hwang wrote: > > hi all! > > i can't speak english well.. > > i want know that file upload... > > Search has a lot of time. > > i can find just one Example > > this link.. > > > http://www.oreillynet.com/ruby/blog/2007/01/the_joy_of_rolling_your_own_wi_1.html > > And it was typed. > > but, error occurs. > > error code(Fold) is... > > Camping Problem!Conf::Controllers::Upload.POST NoMethodError undefined >> method `Tempfile' for "glasses.pdf":String: >> >> - conf_mongrel.rb:224:in `post' >> - (eval):27:in `send' >> - (eval):27:in `service' >> - (eval):46:in `run' >> - /usr/local/lib/site_ruby/1.8/mongrel/camping.rb:53:in `process' >> - /usr/local/lib/site_ruby/1.8/mongrel/camping.rb:52:in `synchronize' >> - /usr/local/lib/site_ruby/1.8/mongrel/camping.rb:52:in `process' >> - /usr/local/lib/site_ruby/1.8/mongrel.rb:159:in `process_client' >> >> > why can't find method? > > my code has this line > require 'tempfile' > > i can't understand.... > > and second question is .... > > What is the way typical file upload in camping? > > i want example code.... > > Curious does not sleep. > > plz teach me. > > thank you for reading my article.. > > have a nice day... > > > _______________________________________________ > Camping-list mailing list > Camping-list at rubyforge.org > http://rubyforge.org/mailman/listinfo/camping-list > > > > _______________________________________________ > Camping-list mailing list > Camping-list at rubyforge.org > http://rubyforge.org/mailman/listinfo/camping-list > -------------- next part -------------- An HTML attachment was scrubbed... URL: From john.beppu at gmail.com Tue Apr 21 01:40:37 2009 From: john.beppu at gmail.com (John Beppu) Date: Mon, 20 Apr 2009 22:40:37 -0700 Subject: hi! plz teach me! about file upload In-Reply-To: References: <6C908BC7-332B-4766-9874-F3FAEA05BF77@creativepony.com> Message-ID: <21a10fe00904202240q6e974881v31a8684f33762f19@mail.gmail.com> Something like this should work for the old version of Camping: class Upload < R '/upload' def get render :upload end def post upload = @input.upload filename = File.basename(upload.filename) puts @input.upload[:tempfile].path puts filename File.link(upload[:tempfile].path, filename) redirect R(Home) end end # the :upload view def upload form.upload(:method => 'post', :enctype => 'multipart/form-data', :action => R(Upload)) { input :type => 'file', :name => 'upload' input.post.button :type => 'submit', :name => 'submit', :value => 'POST' } end 2009/4/1 in-seok hwang > oh... sorry. > > i can't use current version. > I had a lot of code writing. > > i used 1.5.180 camping version. > > when i upgrade to the latest version is a lot of errors. > > but, I want to use the latest version. > > Anyway, > > how do upload file in 1.5.180 > > -------------- next part -------------- An HTML attachment was scrubbed... URL: From his2000x at gmail.com Thu Apr 23 03:41:22 2009 From: his2000x at gmail.com (in-seok hwang) Date: Thu, 23 Apr 2009 16:41:22 +0900 Subject: how i can that connect some controller by div? Message-ID: hi all! i has some question. first, my camping ver is 1.5.180 markaby is 0.5 mongrel is 1.1.5 i want connect some controller by div As a result, i want transfer input text from "Newsctrl" class i will show my code. this is my controller 212 class Newsctrl > 213 def get > 214 p 'render :newsctrl' > 215 render :newsctrl > 216 end > 217 def post > 218 p 'post neonsign' > 219 end > 220 end > this is my views module Conf::Views > 309 def layout > 310 html do > 311 head do > ....Omitted.... > body do > 321 > 322 div :class => 'header' do > 323 #div :class => > 324 " ";br > 325 h1{a 'INFO_AGENT', :href => '/'} > 326 code :class => 'header' do > 327 '$ ????? ????? 303?' > 328 end > 329 end > 330 div :id => 'news-blocker' do > 331 div :id => 'news-text' do > 332 self << news > 333 end > 334 end > 335 > 336 div :id => 'news-button' do > 337 > 338 a "add", :href => "#", :onclick => > "Effect.SlideDown('newsctrl');return false;" > 339 end > 340 div :id => 'newsctrl', :style => "display:none; > width:99%; height:22px;" do > 341 div do > 342 self << newsctrl # i want connect by my > controller, but this code has error occurs > 343 end > 344 end > ....Omitted.... this function is in views 443 def newsctrl > 444 form :method => :post do > 445 label "??";input :name => :title; > 446 label "??";input :name => :name; > 447 input :type => :submit > 448 end > 449 a "close", :href => "#", :onclick => "$('newsctrl').hide(); > return false;" > 450 end > how can i solve my question? plz help me . thank you for reading my article. -------------- next part -------------- An HTML attachment was scrubbed... URL: From blueberry at creativepony.com Thu Apr 23 07:16:23 2009 From: blueberry at creativepony.com (Jenna Fox) Date: Thu, 23 Apr 2009 21:16:23 +1000 Subject: how i can that connect some controller by div? In-Reply-To: References: Message-ID: <5189FC3D-DB41-42F2-8A2B-7EEE1DF31EA5@creativepony.com> Why are you using the 'p' function in your controller? this is strange. You give it a string containing ruby code... maybe closer to what you want is p { render :newctrl } but even then, you are wrapping your entire html response inside a

and probably also yet another layout? recursive craziness I say! On 23/04/2009, at 5:41 PM, in-seok hwang wrote: > hi all! > > i has some question. > > first, my camping ver is 1.5.180 > markaby is 0.5 > mongrel is 1.1.5 > > i want connect some controller by div > As a result, > i want transfer input text from "Newsctrl" class > > i will show my code. > > this is my controller > > 212 class Newsctrl > 213 def get > 214 p 'render :newsctrl' > 215 render :newsctrl > 216 end > 217 def post > 218 p 'post neonsign' > 219 end > 220 end > > > this is my views > > module Conf::Views > 309 def layout > 310 html do > 311 head do > ....Omitted.... > body do > 321 > 322 div :class => 'header' do > 323 #div :class => > 324 " ";br > 325 h1{a 'INFO_AGENT', :href => '/'} > 326 code :class => 'header' do > 327 '$ ????? ????? 303?' > 328 end > 329 end > 330 div :id => 'news-blocker' do > 331 div :id => 'news-text' do > 332 self << news > 333 end > 334 end > 335 > 336 div :id => 'news-button' do > 337 > 338 a "add", :href => "#", :onclick => > "Effect.SlideDown('newsctrl');return false;" > 339 end > 340 div :id => 'newsctrl', :style => "display:none; > width:99%; height:22px;" do > 341 div do > 342 self << newsctrl # i want connect by my > controller, but this code has error occurs > 343 end > 344 end > ....Omitted.... > > this function is in views > > 443 def newsctrl > 444 form :method => :post do > 445 label "??";input :name => :title; > 446 label "??";input :name => :name; > 447 input :type => :submit > 448 end > 449 a "close", :href => "#", :onclick => "$ > ('newsctrl').hide(); return false;" > 450 end > > > how can i solve my question? > > plz help me . > > thank you for reading my article. > _______________________________________________ > Camping-list mailing list > Camping-list at rubyforge.org > http://rubyforge.org/mailman/listinfo/camping-list -------------- next part -------------- An HTML attachment was scrubbed... URL: From kprojection at gmail.com Thu Apr 23 08:34:25 2009 From: kprojection at gmail.com (Eric Mill) Date: Thu, 23 Apr 2009 08:34:25 -0400 Subject: how i can that connect some controller by div? In-Reply-To: <5189FC3D-DB41-42F2-8A2B-7EEE1DF31EA5@creativepony.com> References: <5189FC3D-DB41-42F2-8A2B-7EEE1DF31EA5@creativepony.com> Message-ID: Yeah, what Jenna said. Also, can you show us the error you're getting? -- Eric On Thu, Apr 23, 2009 at 7:16 AM, Jenna Fox wrote: > Why are you using the 'p' function in your controller? this is strange. > You give it a string containing ruby code... maybe closer to what you want > is p { render :newctrl } but even then, you are wrapping your entire html > response inside a

and probably also yet another layout? recursive > craziness I say! > > On 23/04/2009, at 5:41 PM, in-seok hwang wrote: > > hi all! > > i has some question. > > first, my camping ver is 1.5.180 > markaby is 0.5 > mongrel is 1.1.5 > > i want connect some controller by div > As a result, > i want transfer input text from "Newsctrl" class > > i will show my code. > > this is my controller > >> 212 class Newsctrl >> 213 def get >> 214 p 'render :newsctrl' >> 215 render :newsctrl >> 216 end >> 217 def post >> 218 p 'post neonsign' >> 219 end >> 220 end > > > this is my views > >> module Conf::Views >> 309 def layout >> 310 html do >> 311 head do >> ....Omitted.... >> body do >> 321 >> 322 div :class => 'header' do >> 323 #div :class => >> 324 " ";br >> 325 h1{a 'INFO_AGENT', :href => '/'} >> 326 code :class => 'header' do >> 327 '$ ????? ????? 303?' >> 328 end >> 329 end >> 330 div :id => 'news-blocker' do >> 331 div :id => 'news-text' do >> 332 self << news >> 333 end >> 334 end >> 335 >> 336 div :id => 'news-button' do >> 337 >> 338 a "add", :href => "#", :onclick => >> "Effect.SlideDown('newsctrl');return false;" >> 339 end >> 340 div :id => 'newsctrl', :style => "display:none; >> width:99%; height:22px;" do >> 341 div do >> 342 self << newsctrl # i want connect by my >> controller, but this code has error occurs >> 343 end >> 344 end >> ....Omitted.... > > > this function is in views > >> 443 def newsctrl >> 444 form :method => :post do >> 445 label "??";input :name => :title; >> 446 label "??";input :name => :name; >> 447 input :type => :submit >> 448 end >> 449 a "close", :href => "#", :onclick => "$('newsctrl').hide(); >> return false;" >> 450 end > > > how can i solve my question? > > plz help me . > > thank you for reading my article. > _______________________________________________ > Camping-list mailing list > Camping-list at rubyforge.org > http://rubyforge.org/mailman/listinfo/camping-list > > _______________________________________________ > Camping-list mailing list > Camping-list at rubyforge.org > http://rubyforge.org/mailman/listinfo/camping-list > From his2000x at gmail.com Thu Apr 23 11:39:15 2009 From: his2000x at gmail.com (in-seok hwang) Date: Fri, 24 Apr 2009 00:39:15 +0900 Subject: how i can that connect some controller by div? In-Reply-To: References: <5189FC3D-DB41-42F2-8A2B-7EEE1DF31EA5@creativepony.com> Message-ID: hi :) i'm not has error. but click the button, show white page. i want action is easy, first, submit button click! and some action from post function in 'Newsctrl' controller. some action is save(sqlite3) that 2 inputbox's input i thing not connect that views and controller thank you for reading my article... 2009? 4? 23? (?) ?? 9:34, Eric Mill ?? ?: > Yeah, what Jenna said. Also, can you show us the error you're getting? > > -- Eric > > On Thu, Apr 23, 2009 at 7:16 AM, Jenna Fox > wrote: > > Why are you using the 'p' function in your controller? this is strange. > > You give it a string containing ruby code... maybe closer to what you > want > > is p { render :newctrl } but even then, you are wrapping your entire html > > response inside a

and probably also yet another layout? recursive > > craziness I say! > > > > On 23/04/2009, at 5:41 PM, in-seok hwang wrote: > > > > hi all! > > > > i has some question. > > > > first, my camping ver is 1.5.180 > > markaby is 0.5 > > mongrel is 1.1.5 > > > > i want connect some controller by div > > As a result, > > i want transfer input text from "Newsctrl" class > > > > i will show my code. > > > > this is my controller > > > >> 212 class Newsctrl > >> 213 def get > >> 214 p 'render :newsctrl' > >> 215 render :newsctrl > >> 216 end > >> 217 def post > >> 218 p 'post neonsign' > >> 219 end > >> 220 end > > > > > > this is my views > > > >> module Conf::Views > >> 309 def layout > >> 310 html do > >> 311 head do > >> ....Omitted.... > >> body do > >> 321 > >> 322 div :class => 'header' do > >> 323 #div :class => > >> 324 " ";br > >> 325 h1{a 'INFO_AGENT', :href => '/'} > >> 326 code :class => 'header' do > >> 327 '$ ????? ????? 303?' > >> 328 end > >> 329 end > >> 330 div :id => 'news-blocker' do > >> 331 div :id => 'news-text' do > >> 332 self << news > >> 333 end > >> 334 end > >> 335 > >> 336 div :id => 'news-button' do > >> 337 > >> 338 a "add", :href => "#", :onclick => > >> "Effect.SlideDown('newsctrl');return false;" > >> 339 end > >> 340 div :id => 'newsctrl', :style => "display:none; > >> width:99%; height:22px;" do > >> 341 div do > >> 342 self << newsctrl # i want connect by my > >> controller, but this code has error occurs > >> 343 end > >> 344 end > >> ....Omitted.... > > > > > > this function is in views > > > >> 443 def newsctrl > >> 444 form :method => :post do > >> 445 label "??";input :name => :title; > >> 446 label "??";input :name => :name; > >> 447 input :type => :submit > >> 448 end > >> 449 a "close", :href => "#", :onclick => "$('newsctrl').hide(); > >> return false;" > >> 450 end > > > > > > how can i solve my question? > > > > plz help me . > > > > thank you for reading my article. > > _______________________________________________ > > Camping-list mailing list > > Camping-list at rubyforge.org > > http://rubyforge.org/mailman/listinfo/camping-list > > > > _______________________________________________ > > Camping-list mailing list > > Camping-list at rubyforge.org > > http://rubyforge.org/mailman/listinfo/camping-list > > > _______________________________________________ > Camping-list mailing list > Camping-list at rubyforge.org > http://rubyforge.org/mailman/listinfo/camping-list > -------------- next part -------------- An HTML attachment was scrubbed... URL: From his2000x at gmail.com Thu Apr 23 12:20:07 2009 From: his2000x at gmail.com (in-seok hwang) Date: Fri, 24 Apr 2009 01:20:07 +0900 Subject: how i can that connect some controller by div? Message-ID: hi :) i'm not has error. but click the button, show white page. i want action is easy, first, submit button click! and some action from post function in 'Newsctrl' controller. some action is save(sqlite3) that 2 inputbox's input i thing not connect that views and controller thank you for reading my article... -------------- next part -------------- An HTML attachment was scrubbed... URL: From kprojection at gmail.com Thu Apr 23 13:03:49 2009 From: kprojection at gmail.com (Eric Mill) Date: Thu, 23 Apr 2009 13:03:49 -0400 Subject: how i can that connect some controller by div? In-Reply-To: References: <5189FC3D-DB41-42F2-8A2B-7EEE1DF31EA5@creativepony.com> Message-ID: Is "self << newsctrl" the way to go about it? I think maybe you want "yield" there instead. -- Eric On Thu, Apr 23, 2009 at 11:39 AM, in-seok hwang wrote: > hi :) > > i'm not has error. > > but click the button, > show white page. > > i want action is easy, > > first, submit button click! > > and some action from post function in 'Newsctrl' controller. > > some action is save(sqlite3) that 2 inputbox's input > > i thing not connect that views and controller > > thank you for reading my article... > > 2009? 4? 23? (?) ?? 9:34, Eric Mill ?? ?: >> >> Yeah, what Jenna said. Also, can you show us the error you're getting? >> >> -- Eric >> >> On Thu, Apr 23, 2009 at 7:16 AM, Jenna Fox >> wrote: >> > Why are you using the 'p' function in your controller? this is strange. >> > You give it a string containing ruby code... maybe closer to what you >> > want >> > is p { render :newctrl } but even then, you are wrapping your entire >> > html >> > response inside a

and probably also yet another layout? recursive >> > craziness I say! >> > >> > On 23/04/2009, at 5:41 PM, in-seok hwang wrote: >> > >> > hi all! >> > >> > i has some question. >> > >> > first, my camping ver is 1.5.180 >> > markaby is 0.5 >> > mongrel is 1.1.5 >> > >> > i want connect some controller by div >> > As a result, >> > i want transfer input text from "Newsctrl" class >> > >> > i will show my code. >> > >> > this is my controller >> > >> >> 212 class Newsctrl >> >> 213 def get >> >> 214 p 'render :newsctrl' >> >> 215 render :newsctrl >> >> 216 end >> >> 217 def post >> >> 218 p 'post neonsign' >> >> 219 end >> >> 220 end >> > >> > >> > this is my views >> > >> >> module Conf::Views >> >> 309 def layout >> >> 310 html do >> >> 311 head do >> >> ....Omitted.... >> >> body do >> >> 321 >> >> 322 div :class => 'header' do >> >> 323 #div :class => >> >> 324 " ";br >> >> 325 h1{a 'INFO_AGENT', :href => '/'} >> >> 326 code :class => 'header' do >> >> 327 '$ ????? ????? 303?' >> >> 328 end >> >> 329 end >> >> 330 div :id => 'news-blocker' do >> >> 331 div :id => 'news-text' do >> >> 332 self << news >> >> 333 end >> >> 334 end >> >> 335 >> >> 336 div :id => 'news-button' do >> >> 337 >> >> 338 a "add", :href => "#", :onclick => >> >> "Effect.SlideDown('newsctrl');return false;" >> >> 339 end >> >> 340 div :id => 'newsctrl', :style => "display:none; >> >> width:99%; height:22px;" do >> >> 341 div do >> >> 342 self << newsctrl # i want connect by my >> >> controller, but this code has error occurs >> >> 343 end >> >> 344 end >> >> ....Omitted.... >> > >> > >> > this function is in views >> > >> >> 443 def newsctrl >> >> 444 form :method => :post do >> >> 445 label "??";input :name => :title; >> >> 446 label "??";input :name => :name; >> >> 447 input :type => :submit >> >> 448 end >> >> 449 a "close", :href => "#", :onclick => "$('newsctrl').hide(); >> >> return false;" >> >> 450 end >> > >> > >> > how can i solve my question? >> > >> > plz help me . >> > >> > thank you for reading my article. >> > _______________________________________________ >> > Camping-list mailing list >> > Camping-list at rubyforge.org >> > http://rubyforge.org/mailman/listinfo/camping-list >> > >> > _______________________________________________ >> > Camping-list mailing list >> > Camping-list at rubyforge.org >> > http://rubyforge.org/mailman/listinfo/camping-list >> > >> _______________________________________________ >> Camping-list mailing list >> Camping-list at rubyforge.org >> http://rubyforge.org/mailman/listinfo/camping-list > > _______________________________________________ > Camping-list mailing list > Camping-list at rubyforge.org > http://rubyforge.org/mailman/listinfo/camping-list > From john.beppu at gmail.com Thu Apr 23 16:11:01 2009 From: john.beppu at gmail.com (John Beppu) Date: Thu, 23 Apr 2009 13:11:01 -0700 Subject: how i can that connect some controller by div? In-Reply-To: References: <5189FC3D-DB41-42F2-8A2B-7EEE1DF31EA5@creativepony.com> Message-ID: <21a10fe00904231311s31cb09d5i363fe4e8415d0f7c@mail.gmail.com> I could be completely off, but this is my interpretation of things. 1. The p he's using is Kernel#p for debugging output, not Markaby's p. 2. I think he wants the form in his newsctrl view template to submit to the Newsctrl controller. I think he wants something like this: # Do you know about the R() function? def newsctrl form :method => :post, :action => R(Newsctrl) do label "??";input :name => :title; label "??";input :name => :name; input :type => :submit end a "close", :href => "#", :onclick => "$('newsctrl').hide(); return false;" end I'm guessing, here.... --beppu -------------- next part -------------- An HTML attachment was scrubbed... URL: From his2000x at gmail.com Thu Apr 23 20:03:30 2009 From: his2000x at gmail.com (in-seok hwang) Date: Fri, 24 Apr 2009 09:03:30 +0900 Subject: how i can that connect some controller by div? In-Reply-To: <21a10fe00904231311s31cb09d5i363fe4e8415d0f7c@mail.gmail.com> References: <5189FC3D-DB41-42F2-8A2B-7EEE1DF31EA5@creativepony.com> <21a10fe00904231311s31cb09d5i363fe4e8415d0f7c@mail.gmail.com> Message-ID: wow!!! thank you! thank you!! solved problem! camper is sweet! John Beppu's answer is right and next time, i will question. bye :) 2009/4/24 John Beppu > I could be completely off, but this is my interpretation of things. > > > 1. The p he's using is Kernel#p for debugging output, not Markaby's p. > 2. I think he wants the form in his newsctrl view template to submit to > the Newsctrl controller. I think he wants something like this: > > # Do you know about the R() function? > def newsctrl > form :method => :post, :action => R(Newsctrl) do > label "??";input :name => :title; > label "??";input :name => :name; > input :type => :submit > end > a "close", :href => "#", :onclick => "$('newsctrl').hide(); return > false;" > end > > I'm guessing, here.... > > --beppu > > > > _______________________________________________ > Camping-list mailing list > Camping-list at rubyforge.org > http://rubyforge.org/mailman/listinfo/camping-list > -------------- next part -------------- An HTML attachment was scrubbed... URL: From lists at groll.co.za Tue Apr 28 05:17:13 2009 From: lists at groll.co.za (Jonathan Groll) Date: Tue, 28 Apr 2009 11:17:13 +0200 Subject: The subtleties of config.ru, or what to do if you get "Camping problem! / not found" Message-ID: <20090428091713.GA4567@groll.co.za> On Thursday I tried to get the camping blog.rb example working with rack/passenger/apache. The config.ru (below) resulted in Camping Problem! / not found require 'rubygems' require 'rack' require 'camping' Camping.goes :Blog Blog::Models::Base.establish_connection :adapter => "sqlite3", :database => "/home/jonathan/.camping.db" run Blog This is what it should have in it: require 'rubygems' require 'rack' require 'camping' require 'blog' Blog::Models::Base.establish_connection :adapter => "sqlite3", :database => "/home/jonathan/.camping.db" run Blog When the top version of config.ru is run, it results in the route maker getting a 'constants' array consisting only of ["I"] (instead of ["Style", "Logout", "Login", "PostN", "I", "Index", "PostNew", "Edit"] ). What magic sets the constants array? (couldn't find it with a quick grep through the code) I guess this is an easy mistake to make (at least for me it was) if you just read the phusion passenger user guide which explicitly says use "Camping.goes". So if anyone else sees this message, set config.ru as above. Cheers, Jonathan P.S. one would think that putting a require 'blog' before the Camping.goes and commenting out the Camping.goes in blog.rb would fix things with the first approach, but I stumbled into a whole hornets nest of errors relating to Blog::Models::Base when I tried that.