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: <http://rubyforge.org/pipermail/camping-list/attachments/20090423/2ef9c09f/attachment.html>
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 <p> 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: <http://rubyforge.org/pipermail/camping-list/attachments/20090423/5b3cb708/attachment-0001.html>
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 <blueberry at creativepony.com> 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 <p> 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 >
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 <kprojection at gmail.com>?? ?:> 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 <blueberry at creativepony.com> > 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 <p> 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: <http://rubyforge.org/pipermail/camping-list/attachments/20090424/1d4bbcc2/attachment.html>
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: <http://rubyforge.org/pipermail/camping-list/attachments/20090424/c05223d8/attachment.html>
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 <his2000x at gmail.com> 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 <kprojection at gmail.com>?? ?: >> >> 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 <blueberry at creativepony.com> >> 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 <p> 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 >
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: <http://rubyforge.org/pipermail/camping-list/attachments/20090423/22f39fb4/attachment-0001.html>
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 <john.beppu at 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 > > > > _______________________________________________ > Camping-list mailing list > Camping-list at rubyforge.org > http://rubyforge.org/mailman/listinfo/camping-list >-------------- next part -------------- An HTML attachment was scrubbed... URL: <http://rubyforge.org/pipermail/camping-list/attachments/20090424/764be394/attachment.html>