I''m trying now to do "sudo fixrbconfig" in the terminal, and I get this: /usr/lib/ruby/1.8/powerpc-darwin8.0/ruby.h does not exist. This probably means you haven''t yet installed Xcode from the Tiger DVD. You won''t be able to compile Ruby extensions without it. Please install it then rerun this program. I''m on an intel mac. Am I unable to use fixrbconfig? -- Posted via http://www.ruby-forum.com/.
Oskar wrote:> I''m trying now to do "sudo fixrbconfig" in the terminal, and I get this: > > /usr/lib/ruby/1.8/powerpc-darwin8.0/ruby.h does not exist. This > probably means you haven''t yet installed Xcode from the Tiger DVD. You > won''t be able to compile Ruby extensions without it. Please install it > then rerun this program. > > I''m on an intel mac. Am I unable to use fixrbconfig?Oh, BTW, I HAVE installed Xcode. -- Posted via http://www.ruby-forum.com/.
I have a lovely web-application, under controller "Child", and would like to "include" it in a page under another application having controller "Parent." The natural way to do this, I would have thought, would be to incorporate it in one of Parent''s views using render_component, thus: <%= render_component :controller => "Child", :action => "foo" %> ----- So far, so good. The page appears to render wonderfully in the parent app, just as I intended. My problem is that internal links and more important, Ajax urls on that page, generated by the view in child/view/foo.rhtml comes from code like the following: <%= link_to :action => "bar1" %> .... <%= form_remote_tag :url => { :action => "bar2"} . . . .... <%= link_to_remote :action => "bar2" %> and the like. ----- The links, when running from a call to "http://localhost:3000/child/ foo", properly generate links to the corresponding portions of Child, generating urls like: child/bar1 child/bar2 child/bar3 but when running under Parent, using the "render_component" generates parent/bar1 parent/bar2 parent/bar3 which is not inconsistent with the documentation, but inconsistent with my intent. Particularly when trying to componentize an Ajax application, this is a disappointing result, as I was hoping to encapsulate the internal portions of, in this case, a form editor. One solution, of course, is to simply rewrite the sub-app with every link_to, form_remote_tag and link_to_remote having a hard- coded :controller parm, but is that the Rails way? Is there a better, simpler way to accomplish what I desire? Thanks for your time and thoughts.
if you want to have a hard-link that does not depend on external call, you would have hard-coded controller name not sure why you don''t like that idea On 3/19/06, Andrew Greenberg <werdna@mucow.com> wrote:> > I have a lovely web-application, under controller "Child", and would > like to "include" it in a page under another application having > controller "Parent." The natural way to do this, I would have > thought, would be to incorporate it in one of Parent''s views using > render_component, thus: > > <%= render_component :controller => "Child", :action => "foo" %> > > ----- > > So far, so good. The page appears to render wonderfully in the > parent app, just as I intended. My problem is that internal links > and more important, Ajax urls on that page, generated by the view in > child/view/foo.rhtml comes from code like the following: > > <%= link_to :action => "bar1" %> > .... > <%= form_remote_tag :url => { :action => "bar2"} . . . > .... > <%= link_to_remote :action => "bar2" %> > > and the like. > > ----- > > The links, when running from a call to "http://localhost:3000/child/ > foo", properly generate links to the corresponding portions of Child, > generating urls like: > > child/bar1 > child/bar2 > child/bar3 > > but when running under Parent, using the "render_component" generates > > parent/bar1 > parent/bar2 > parent/bar3 > > which is not inconsistent with the documentation, but inconsistent > with my intent. Particularly when trying to componentize an Ajax > application, this is a disappointing result, as I was hoping to > encapsulate the internal portions of, in this case, a form editor. > > One solution, of course, is to simply rewrite the sub-app with every > link_to, form_remote_tag and link_to_remote having a hard- > coded :controller parm, but is that the Rails way? Is there a > better, simpler way to accomplish what I desire? > > Thanks for your time and thoughts. > > _______________________________________________ > Rails mailing list > Rails@lists.rubyonrails.org > http://lists.rubyonrails.org/mailman/listinfo/rails >-------------- next part -------------- An HTML attachment was scrubbed... URL: http://wrath.rubyonrails.org/pipermail/rails/attachments/20060318/f2d6663e/attachment-0001.html
I can certainly do it, but it seems inelegant to me. That''s why I asked the question. Mostly, the code can''t trivially be reused by adding to another controller, or the controller can''t be renamed without grep/changing all the view code. Clearly, that can be handled in a generator, but I was wondering if there was a simpler way. On Mar 18, 2006, at 5:10 PM, Emin Hasanov wrote:> if you want to have a hard-link that does not depend on external > call, you would have hard-coded controller name > > not sure why you don''t like that idea > > On 3/19/06, Andrew Greenberg <werdna@mucow.com> wrote: > I have a lovely web-application, under controller "Child", and would > like to "include" it in a page under another application having > controller "Parent." The natural way to do this, I would have > thought, would be to incorporate it in one of Parent''s views using > render_component, thus: > > <%= render_component :controller => "Child", :action => > "foo" %> > > ----- > > So far, so good. The page appears to render wonderfully in the > parent app, just as I intended. My problem is that internal links > and more important, Ajax urls on that page, generated by the view in > child/view/foo.rhtml comes from code like the following: > > <%= link_to :action => "bar1" %> > .... > <%= form_remote_tag :url => { :action => "bar2"} . . . > .... > <%= link_to_remote :action => "bar2" %> > > and the like. > > ----- > > The links, when running from a call to "http://localhost:3000/child/ > foo", properly generate links to the corresponding portions of Child, > generating urls like: > > child/bar1 > child/bar2 > child/bar3 > > but when running under Parent, using the "render_component" generates > > parent/bar1 > parent/bar2 > parent/bar3 > > which is not inconsistent with the documentation, but inconsistent > with my intent. Particularly when trying to componentize an Ajax > application, this is a disappointing result, as I was hoping to > encapsulate the internal portions of, in this case, a form editor. > > One solution, of course, is to simply rewrite the sub-app with every > link_to, form_remote_tag and link_to_remote having a hard- > coded :controller parm, but is that the Rails way? Is there a > better, simpler way to accomplish what I desire? > > Thanks for your time and thoughts. > > _______________________________________________ > Rails mailing list > Rails@lists.rubyonrails.org > http://lists.rubyonrails.org/mailman/listinfo/rails > > _______________________________________________ > Rails mailing list > Rails@lists.rubyonrails.org > http://lists.rubyonrails.org/mailman/listinfo/rails-------------- next part -------------- An HTML attachment was scrubbed... URL: http://wrath.rubyonrails.org/pipermail/rails/attachments/20060318/35bdbb2c/attachment.html
if you want to reuse the code you can use *controller_name* to get the name automatically On 3/19/06, Andrew Greenberg <werdna@mucow.com> wrote:> > I can certainly do it, but it seems inelegant to me. That''s why I asked > the question. > Mostly, the code can''t trivially be reused by adding to another > controller, or the controller can''t be renamed without grep/changing all the > view code. Clearly, that can be handled in a generator, but I was wondering > if there was a simpler way. > > On Mar 18, 2006, at 5:10 PM, Emin Hasanov wrote: > > if you want to have a hard-link that does not depend on external call, you > would have hard-coded controller name > > not sure why you don''t like that idea > > On 3/19/06, Andrew Greenberg <werdna@mucow.com> wrote: > > > > I have a lovely web-application, under controller "Child", and would > > like to "include" it in a page under another application having > > controller "Parent." The natural way to do this, I would have > > thought, would be to incorporate it in one of Parent''s views using > > render_component, thus: > > > > <%= render_component :controller => "Child", :action => "foo" %> > > > > ----- > > > > So far, so good. The page appears to render wonderfully in the > > parent app, just as I intended. My problem is that internal links > > and more important, Ajax urls on that page, generated by the view in > > child/view/foo.rhtml comes from code like the following: > > > > <%= link_to :action => "bar1" %> > > .... > > <%= form_remote_tag :url => { :action => "bar2"} . . . > > .... > > <%= link_to_remote :action => "bar2" %> > > > > and the like. > > > > ----- > > > > The links, when running from a call to "http://localhost:3000/child/ > > foo", properly generate links to the corresponding portions of Child, > > generating urls like: > > > > child/bar1 > > child/bar2 > > child/bar3 > > > > but when running under Parent, using the "render_component" generates > > > > parent/bar1 > > parent/bar2 > > parent/bar3 > > > > which is not inconsistent with the documentation, but inconsistent > > with my intent. Particularly when trying to componentize an Ajax > > application, this is a disappointing result, as I was hoping to > > encapsulate the internal portions of, in this case, a form editor. > > > > One solution, of course, is to simply rewrite the sub-app with every > > link_to, form_remote_tag and link_to_remote having a hard- > > coded :controller parm, but is that the Rails way? Is there a > > better, simpler way to accomplish what I desire? > > > > Thanks for your time and thoughts. > > > > _______________________________________________ > > Rails mailing list > > Rails@lists.rubyonrails.org > > http://lists.rubyonrails.org/mailman/listinfo/rails > > > > _______________________________________________ > Rails mailing list > Rails@lists.rubyonrails.org > http://lists.rubyonrails.org/mailman/listinfo/rails > > > > _______________________________________________ > Rails mailing list > Rails@lists.rubyonrails.org > http://lists.rubyonrails.org/mailman/listinfo/rails > > >-------------- next part -------------- An HTML attachment was scrubbed... URL: http://wrath.rubyonrails.org/pipermail/rails/attachments/20060318/8ab7294b/attachment.html
David Felstead
2006-Mar-18 23:52 UTC
[Rails] Re: fixrbconfig - does it work on intel macs?
I would imagine you need to change the ''powerpc-darwin8.0'' bit in the fixrbconfig.rb script to whatever the directory is called on intel mac os x - perhaps something like ''x86-darwin8.0''. Have a look in the /usr/lib/ruby/1.8 directory and see what the architecture specific directory is called. -DF On 3/19/06, Oskar <xeubie@hotmail.com> wrote:> Oskar wrote: > > I''m trying now to do "sudo fixrbconfig" in the terminal, and I get this: > > > > /usr/lib/ruby/1.8/powerpc-darwin8.0/ruby.h does not exist. This > > probably means you haven''t yet installed Xcode from the Tiger DVD. You > > won''t be able to compile Ruby extensions without it. Please install it > > then rerun this program. > > > > I''m on an intel mac. Am I unable to use fixrbconfig? > > Oh, BTW, I HAVE installed Xcode. > > -- > Posted via http://www.ruby-forum.com/. > _______________________________________________ > Rails mailing list > Rails@lists.rubyonrails.org > http://lists.rubyonrails.org/mailman/listinfo/rails >
That certainly works, and gets me most of the way there. Is that my best alternative? On Mar 18, 2006, at 5:28 PM, Emin Hasanov wrote:> if you want to reuse the code you can use controller_name to get > the name automatically > > On 3/19/06, Andrew Greenberg < werdna@mucow.com> wrote: > I can certainly do it, but it seems inelegant to me. That''s why I > asked the question. > > Mostly, the code can''t trivially be reused by adding to another > controller, or the controller can''t be renamed without grep/ > changing all the view code. Clearly, that can be handled in a > generator, but I was wondering if there was a simpler way. > > On Mar 18, 2006, at 5:10 PM, Emin Hasanov wrote: > >> if you want to have a hard-link that does not depend on external >> call, you would have hard-coded controller name >> >> not sure why you don''t like that idea >> >> On 3/19/06, Andrew Greenberg < werdna@mucow.com> wrote: >> I have a lovely web-application, under controller "Child", and would >> like to "include" it in a page under another application having >> controller "Parent." The natural way to do this, I would have >> thought, would be to incorporate it in one of Parent''s views using >> render_component, thus: >> >> <%= render_component :controller => "Child", :action => >> "foo" %> >> >> ----- >> >> So far, so good. The page appears to render wonderfully in the >> parent app, just as I intended. My problem is that internal links >> and more important, Ajax urls on that page, generated by the view in >> child/view/foo.rhtml comes from code like the following: >> >> <%= link_to :action => "bar1" %> >> .... >> <%= form_remote_tag :url => { :action => "bar2"} . . . >> .... >> <%= link_to_remote :action => "bar2" %> >> >> and the like. >> >> ----- >> >> The links, when running from a call to " http://localhost:3000/child/ >> foo", properly generate links to the corresponding portions of Child, >> generating urls like: >> >> child/bar1 >> child/bar2 >> child/bar3 >> >> but when running under Parent, using the "render_component" generates >> >> parent/bar1 >> parent/bar2 >> parent/bar3 >> >> which is not inconsistent with the documentation, but inconsistent >> with my intent. Particularly when trying to componentize an Ajax >> application, this is a disappointing result, as I was hoping to >> encapsulate the internal portions of, in this case, a form editor. >> >> One solution, of course, is to simply rewrite the sub-app with every >> link_to, form_remote_tag and link_to_remote having a hard- >> coded :controller parm, but is that the Rails way? Is there a >> better, simpler way to accomplish what I desire? >> >> Thanks for your time and thoughts. >> >> _______________________________________________ >> Rails mailing list >> Rails@lists.rubyonrails.org >> http://lists.rubyonrails.org/mailman/listinfo/rails >> >> _______________________________________________ >> Rails mailing list >> Rails@lists.rubyonrails.org >> http://lists.rubyonrails.org/mailman/listinfo/rails > > > _______________________________________________ > Rails mailing list > Rails@lists.rubyonrails.org > http://lists.rubyonrails.org/mailman/listinfo/rails > > > > _______________________________________________ > Rails mailing list > Rails@lists.rubyonrails.org > http://lists.rubyonrails.org/mailman/listinfo/rails-------------- next part -------------- An HTML attachment was scrubbed... URL: http://wrath.rubyonrails.org/pipermail/rails/attachments/20060319/1474eb2f/attachment.html
I reccomend to just bite the bullet and compile your own ruby. The osx one is broken and even with the fixrbconfig script it is not a very good ruby binary. I have had much better luck with self compiled ruby. Here is a link to a script that will instal ruby from source for you or you can look in it to get the steps: http://nubyonrails.com/files/ru-ra-lim.sh.zip -Ezra On Mar 18, 2006, at 4:24 PM, Andrew Greenberg wrote:> That certainly works, and gets me most of the way there. Is that > my best alternative? > > On Mar 18, 2006, at 5:28 PM, Emin Hasanov wrote: > >> if you want to reuse the code you can use controller_name to get >> the name automatically >> >> On 3/19/06, Andrew Greenberg < werdna@mucow.com> wrote: >> I can certainly do it, but it seems inelegant to me. That''s why I >> asked the question. >> >> Mostly, the code can''t trivially be reused by adding to another >> controller, or the controller can''t be renamed without grep/ >> changing all the view code. Clearly, that can be handled in a >> generator, but I was wondering if there was a simpler way. >> >> On Mar 18, 2006, at 5:10 PM, Emin Hasanov wrote: >> >>> if you want to have a hard-link that does not depend on external >>> call, you would have hard-coded controller name >>> >>> not sure why you don''t like that idea >>> >>> On 3/19/06, Andrew Greenberg < werdna@mucow.com> wrote: >>> I have a lovely web-application, under controller "Child", and would >>> like to "include" it in a page under another application having >>> controller "Parent." The natural way to do this, I would have >>> thought, would be to incorporate it in one of Parent''s views using >>> render_component, thus: >>> >>> <%= render_component :controller => "Child", :action => >>> "foo" %> >>> >>> ----- >>> >>> So far, so good. The page appears to render wonderfully in the >>> parent app, just as I intended. My problem is that internal links >>> and more important, Ajax urls on that page, generated by the view in >>> child/view/foo.rhtml comes from code like the following: >>> >>> <%= link_to :action => "bar1" %> >>> .... >>> <%= form_remote_tag :url => { :action => "bar2"} . . . >>> .... >>> <%= link_to_remote :action => "bar2" %> >>> >>> and the like. >>> >>> ----- >>> >>> The links, when running from a call to " http://localhost:3000/ >>> child/ >>> foo", properly generate links to the corresponding portions of >>> Child, >>> generating urls like: >>> >>> child/bar1 >>> child/bar2 >>> child/bar3 >>> >>> but when running under Parent, using the "render_component" >>> generates >>> >>> parent/bar1 >>> parent/bar2 >>> parent/bar3 >>> >>> which is not inconsistent with the documentation, but inconsistent >>> with my intent. Particularly when trying to componentize an Ajax >>> application, this is a disappointing result, as I was hoping to >>> encapsulate the internal portions of, in this case, a form editor. >>> >>> One solution, of course, is to simply rewrite the sub-app with every >>> link_to, form_remote_tag and link_to_remote having a hard- >>> coded :controller parm, but is that the Rails way? Is there a >>> better, simpler way to accomplish what I desire? >>> >>> Thanks for your time and thoughts. >>> >>> _______________________________________________ >>> Rails mailing list >>> Rails@lists.rubyonrails.org >>> http://lists.rubyonrails.org/mailman/listinfo/rails >>> >>> _______________________________________________ >>> Rails mailing list >>> Rails@lists.rubyonrails.org >>> http://lists.rubyonrails.org/mailman/listinfo/rails >> >> >> _______________________________________________ >> Rails mailing list >> Rails@lists.rubyonrails.org >> http://lists.rubyonrails.org/mailman/listinfo/rails >> >> >> >> _______________________________________________ >> Rails mailing list >> Rails@lists.rubyonrails.org >> http://lists.rubyonrails.org/mailman/listinfo/rails > > _______________________________________________ > Rails mailing list > Rails@lists.rubyonrails.org > http://lists.rubyonrails.org/mailman/listinfo/rails-------------- next part -------------- An HTML attachment was scrubbed... URL: http://wrath.rubyonrails.org/pipermail/rails/attachments/20060319/ac7ab91d/attachment.html
That will work, but I still don''t understand what is happening here. While the link_to, form_remote_tag and link_to_remote routines all use the CALLING controller, Parent, other code in the view, in particular render commands use the CALLED component controller, Child! Isn''t this behavior strange or inconsistent? Why doesn''t urls generated from the child controller default to the child controller rather than the parent, and if so, why wouldn''t render work the same way? Is there any formal way for me to understand Rails'' behavior here? On Mar 18, 2006, at 5:10 PM, Emin Hasanov wrote:> if you want to have a hard-link that does not depend on external > call, you would have hard-coded controller name > > not sure why you don''t like that idea > > On 3/19/06, Andrew Greenberg <werdna@mucow.com> wrote: > I have a lovely web-application, under controller "Child", and would > like to "include" it in a page under another application having > controller "Parent." The natural way to do this, I would have > thought, would be to incorporate it in one of Parent''s views using > render_component, thus: > > <%= render_component :controller => "Child", :action => > "foo" %> > > ----- > > So far, so good. The page appears to render wonderfully in the > parent app, just as I intended. My problem is that internal links > and more important, Ajax urls on that page, generated by the view in > child/view/foo.rhtml comes from code like the following: > > <%= link_to :action => "bar1" %> > .... > <%= form_remote_tag :url => { :action => "bar2"} . . . > .... > <%= link_to_remote :action => "bar2" %> > > and the like. > > ----- > > The links, when running from a call to "http://localhost:3000/child/ > foo", properly generate links to the corresponding portions of Child, > generating urls like: > > child/bar1 > child/bar2 > child/bar3 > > but when running under Parent, using the "render_component" generates > > parent/bar1 > parent/bar2 > parent/bar3 > > which is not inconsistent with the documentation, but inconsistent > with my intent. Particularly when trying to componentize an Ajax > application, this is a disappointing result, as I was hoping to > encapsulate the internal portions of, in this case, a form editor. > > One solution, of course, is to simply rewrite the sub-app with every > link_to, form_remote_tag and link_to_remote having a hard- > coded :controller parm, but is that the Rails way? Is there a > better, simpler way to accomplish what I desire? > > Thanks for your time and thoughts. > > _______________________________________________ > Rails mailing list > Rails@lists.rubyonrails.org > http://lists.rubyonrails.org/mailman/listinfo/rails > > _______________________________________________ > Rails mailing list > Rails@lists.rubyonrails.org > http://lists.rubyonrails.org/mailman/listinfo/rails-------------- next part -------------- An HTML attachment was scrubbed... URL: http://wrath.rubyonrails.org/pipermail/rails/attachments/20060319/c37278d6/attachment.html
This is just the way it is done, though not exactly like you said. http://api.rubyonrails.com/classes/ActionController/Base.html#M000174 "When generating a new URL, missing values may be filled in from the current request''s parameters." Note, it says current request, not calling/called controller Nothing stops you from overwriting this function and using your own approach On 3/19/06, Andrew Greenberg <werdna@mucow.com> wrote:> > That will work, but I still don''t understand what is happening here. > While the link_to, form_remote_tag and link_to_remote routines all use the > CALLING controller, Parent, other code in the view, in particular render > commands use the CALLED component controller, Child! Isn''t this behavior > strange or inconsistent? Why doesn''t urls generated from the child > controller default to the child controller rather than the parent, and if > so, why wouldn''t render work the same way? Is there any formal way for me > to understand Rails'' behavior here? > > On Mar 18, 2006, at 5:10 PM, Emin Hasanov wrote: > > if you want to have a hard-link that does not depend on external call, you > would have hard-coded controller name > > not sure why you don''t like that idea > > On 3/19/06, Andrew Greenberg <werdna@mucow.com> wrote: > > > > I have a lovely web-application, under controller "Child", and would > > like to "include" it in a page under another application having > > controller "Parent." The natural way to do this, I would have > > thought, would be to incorporate it in one of Parent''s views using > > render_component, thus: > > > > <%= render_component :controller => "Child", :action => "foo" %> > > > > ----- > > > > So far, so good. The page appears to render wonderfully in the > > parent app, just as I intended. My problem is that internal links > > and more important, Ajax urls on that page, generated by the view in > > child/view/foo.rhtml comes from code like the following: > > > > <%= link_to :action => "bar1" %> > > .... > > <%= form_remote_tag :url => { :action => "bar2"} . . . > > .... > > <%= link_to_remote :action => "bar2" %> > > > > and the like. > > > > ----- > > > > The links, when running from a call to "http://localhost:3000/child/ > > foo", properly generate links to the corresponding portions of Child, > > generating urls like: > > > > child/bar1 > > child/bar2 > > child/bar3 > > > > but when running under Parent, using the "render_component" generates > > > > parent/bar1 > > parent/bar2 > > parent/bar3 > > > > which is not inconsistent with the documentation, but inconsistent > > with my intent. Particularly when trying to componentize an Ajax > > application, this is a disappointing result, as I was hoping to > > encapsulate the internal portions of, in this case, a form editor. > > > > One solution, of course, is to simply rewrite the sub-app with every > > link_to, form_remote_tag and link_to_remote having a hard- > > coded :controller parm, but is that the Rails way? Is there a > > better, simpler way to accomplish what I desire? > > > > Thanks for your time and thoughts. > > > > _______________________________________________ > > Rails mailing list > > Rails@lists.rubyonrails.org > > http://lists.rubyonrails.org/mailman/listinfo/rails > > > > _______________________________________________ > Rails mailing list > Rails@lists.rubyonrails.org > http://lists.rubyonrails.org/mailman/listinfo/rails > > > > _______________________________________________ > Rails mailing list > Rails@lists.rubyonrails.org > http://lists.rubyonrails.org/mailman/listinfo/rails > > >-------------- next part -------------- An HTML attachment was scrubbed... URL: http://wrath.rubyonrails.org/pipermail/rails/attachments/20060319/f968c633/attachment-0001.html
On 18 Mar 2006, at 21:28, Oskar wrote:> I''m trying now to do "sudo fixrbconfig" in the terminal, and I get > this: > > /usr/lib/ruby/1.8/powerpc-darwin8.0/ruby.h does not exist. This > probably means you haven''t yet installed Xcode from the Tiger DVD. > You > won''t be able to compile Ruby extensions without it. Please install it > then rerun this program. > > I''m on an intel mac. Am I unable to use fixrbconfig?The clue is in the path it''s looking for ruby.h - it''s hard-coded for looking in the powerpc-darwin8.0 directory, which I''m guessing won''t exist on an Intel architecture machine for obvious reasons. :-) Try doing this on the command line cd /usr/lib/ruby/1.8/ ln -s universal-darwin8.0/* powerpc-darwin8.0 Then try again. Hope that fixes it for you. -- Paul Robinson
Thanks so very much. I get it now, and it makes sense. why do the render commands work differently? On Mar 19, 2006, at 1:49 PM, Emin Hasanov wrote:> This is just the way it is done, though not exactly like you said. > > http://api.rubyonrails.com/classes/ActionController/Base.html#M000174 > "When generating a new URL, missing values may be filled in from > the current request''s parameters." > Note, it says current request, not calling/called controller > > Nothing stops you from overwriting this function and using your own > approach > > > On 3/19/06, Andrew Greenberg <werdna@mucow.com> wrote: > That will work, but I still don''t understand what is happening here. > > While the link_to, form_remote_tag and link_to_remote routines all > use the CALLING controller, Parent, other code in the view, in > particular render commands use the CALLED component controller, > Child! Isn''t this behavior strange or inconsistent? Why doesn''t > urls generated from the child controller default to the child > controller rather than the parent, and if so, why wouldn''t render > work the same way? Is there any formal way for me to understand > Rails'' behavior here? > > On Mar 18, 2006, at 5:10 PM, Emin Hasanov wrote: > >> if you want to have a hard-link that does not depend on external >> call, you would have hard-coded controller name >> >> not sure why you don''t like that idea >> >> On 3/19/06, Andrew Greenberg <werdna@mucow.com> wrote: >> I have a lovely web-application, under controller "Child", and would >> like to "include" it in a page under another application having >> controller "Parent." The natural way to do this, I would have >> thought, would be to incorporate it in one of Parent''s views using >> render_component, thus: >> >> <%= render_component :controller => "Child", :action => >> "foo" %> >> >> ----- >> >> So far, so good. The page appears to render wonderfully in the >> parent app, just as I intended. My problem is that internal links >> and more important, Ajax urls on that page, generated by the view in >> child/view/foo.rhtml comes from code like the following: >> >> <%= link_to :action => "bar1" %> >> .... >> <%= form_remote_tag :url => { :action => "bar2"} . . . >> .... >> <%= link_to_remote :action => "bar2" %> >> >> and the like. >> >> ----- >> >> The links, when running from a call to "http://localhost:3000/child/ >> foo", properly generate links to the corresponding portions of Child, >> generating urls like: >> >> child/bar1 >> child/bar2 >> child/bar3 >> >> but when running under Parent, using the "render_component" generates >> >> parent/bar1 >> parent/bar2 >> parent/bar3 >> >> which is not inconsistent with the documentation, but inconsistent >> with my intent. Particularly when trying to componentize an Ajax >> application, this is a disappointing result, as I was hoping to >> encapsulate the internal portions of, in this case, a form editor. >> >> One solution, of course, is to simply rewrite the sub-app with every >> link_to, form_remote_tag and link_to_remote having a hard- >> coded :controller parm, but is that the Rails way? Is there a >> better, simpler way to accomplish what I desire? >> >> Thanks for your time and thoughts. >> >> _______________________________________________ >> Rails mailing list >> Rails@lists.rubyonrails.org >> http://lists.rubyonrails.org/mailman/listinfo/rails >> >> _______________________________________________ >> Rails mailing list >> Rails@lists.rubyonrails.org >> http://lists.rubyonrails.org/mailman/listinfo/rails > > > _______________________________________________ > Rails mailing list > Rails@lists.rubyonrails.org > http://lists.rubyonrails.org/mailman/listinfo/rails > > > > _______________________________________________ > Rails mailing list > Rails@lists.rubyonrails.org > http://lists.rubyonrails.org/mailman/listinfo/rails-------------- next part -------------- An HTML attachment was scrubbed... URL: http://wrath.rubyonrails.org/pipermail/rails/attachments/20060320/d639d4c4/attachment.html
rendering is completely different story and is based on actions not controllers, therefore if you don''t specify anything it will use current action On 3/20/06, Andrew Greenberg <werdna@mucow.com> wrote:> > Thanks so very much. I get it now, and it makes sense. > why do the render commands work differently? > > On Mar 19, 2006, at 1:49 PM, Emin Hasanov wrote: > > This is just the way it is done, though not exactly like you said. > > http://api.rubyonrails.com/classes/ActionController/Base.html#M000174 > "When generating a new URL, missing values may be filled in from the > current request''s parameters." > Note, it says current request, not calling/called controller > > Nothing stops you from overwriting this function and using your own > approach > > > On 3/19/06, Andrew Greenberg <werdna@mucow.com> wrote: > > > > That will work, but I still don''t understand what is happening here. > > While the link_to, form_remote_tag and link_to_remote routines all use > > the CALLING controller, Parent, other code in the view, in particular render > > commands use the CALLED component controller, Child! Isn''t this behavior > > strange or inconsistent? Why doesn''t urls generated from the child > > controller default to the child controller rather than the parent, and if > > so, why wouldn''t render work the same way? Is there any formal way for me > > to understand Rails'' behavior here? > > > > On Mar 18, 2006, at 5:10 PM, Emin Hasanov wrote: > > > > if you want to have a hard-link that does not depend on external call, > > you would have hard-coded controller name > > > > not sure why you don''t like that idea > > > > On 3/19/06, Andrew Greenberg <werdna@mucow.com> wrote: > > > > > > I have a lovely web-application, under controller "Child", and would > > > like to "include" it in a page under another application having > > > controller "Parent." The natural way to do this, I would have > > > thought, would be to incorporate it in one of Parent''s views using > > > render_component, thus: > > > > > > <%= render_component :controller => "Child", :action => "foo" > > > %> > > > > > > ----- > > > > > > So far, so good. The page appears to render wonderfully in the > > > parent app, just as I intended. My problem is that internal links > > > and more important, Ajax urls on that page, generated by the view in > > > child/view/foo.rhtml comes from code like the following: > > > > > > <%= link_to :action => "bar1" %> > > > .... > > > <%= form_remote_tag :url => { :action => "bar2"} . . . > > > .... > > > <%= link_to_remote :action => "bar2" %> > > > > > > and the like. > > > > > > ----- > > > > > > The links, when running from a call to "http://localhost:3000/child/ > > > foo", properly generate links to the corresponding portions of Child, > > > generating urls like: > > > > > > child/bar1 > > > child/bar2 > > > child/bar3 > > > > > > but when running under Parent, using the "render_component" generates > > > > > > parent/bar1 > > > parent/bar2 > > > parent/bar3 > > > > > > which is not inconsistent with the documentation, but inconsistent > > > with my intent. Particularly when trying to componentize an Ajax > > > application, this is a disappointing result, as I was hoping to > > > encapsulate the internal portions of, in this case, a form editor. > > > > > > One solution, of course, is to simply rewrite the sub-app with every > > > link_to, form_remote_tag and link_to_remote having a hard- > > > coded :controller parm, but is that the Rails way? Is there a > > > better, simpler way to accomplish what I desire? > > > > > > Thanks for your time and thoughts. > > > > > > _______________________________________________ > > > Rails mailing list > > > Rails@lists.rubyonrails.org > > > http://lists.rubyonrails.org/mailman/listinfo/rails > > > > > > > _______________________________________________ > > Rails mailing list > > Rails@lists.rubyonrails.org > > http://lists.rubyonrails.org/mailman/listinfo/rails > > > > > > > > _______________________________________________ > > Rails mailing list > > Rails@lists.rubyonrails.org > > http://lists.rubyonrails.org/mailman/listinfo/rails > > > > > > > _______________________________________________ > Rails mailing list > Rails@lists.rubyonrails.org > http://lists.rubyonrails.org/mailman/listinfo/rails > > > > _______________________________________________ > Rails mailing list > Rails@lists.rubyonrails.org > http://lists.rubyonrails.org/mailman/listinfo/rails > > >-------------- next part -------------- An HTML attachment was scrubbed... URL: http://wrath.rubyonrails.org/pipermail/rails/attachments/20060320/7f07cf35/attachment.html
I am not sure I am being clear, based on your response. Controller parent has an action, say index, and index.rhtml, its view, includes the following command: . . . . render_component :controller => "Child" :action => "foo" . . . . and foo has a view including the following in views/child/foo.rhtml: . . . . link_remote_to :action => "bar1" . . . . . . . form_remote_tag :action => "bar2" . . . . . . . render :partial=>"bar3" . . . . . . . The partial generates the partial specified in "shmoo.rhtml" in the CHILD directory, but the link_remote_to generates a link to "http:/ mydomain.com/parent/bar1" and the form_remote_tag generates a call upon submission to "http://mydomain.com/parent/bar2" It still seems confusing to me, although I think I am beginning to "feel" ok about it at end. On Mar 20, 2006, at 2:34 AM, Emin Hasanov wrote:> rendering is completely different story and is based on actions not > controllers, therefore if you don''t specify anything it will use > current action > > On 3/20/06, Andrew Greenberg <werdna@mucow.com> wrote: > Thanks so very much. I get it now, and it makes sense. > > why do the render commands work differently? > > On Mar 19, 2006, at 1:49 PM, Emin Hasanov wrote: > >> This is just the way it is done, though not exactly like you said. >> >> http://api.rubyonrails.com/classes/ActionController/Base.html#M000174 >> "When generating a new URL, missing values may be filled in from >> the current request''s parameters." >> Note, it says current request, not calling/called controller >> >> Nothing stops you from overwriting this function and using your >> own approach >> >> >> On 3/19/06, Andrew Greenberg < werdna@mucow.com> wrote: >> That will work, but I still don''t understand what is happening here. >> >> While the link_to, form_remote_tag and link_to_remote routines all >> use the CALLING controller, Parent, other code in the view, in >> particular render commands use the CALLED component controller, >> Child! Isn''t this behavior strange or inconsistent? Why doesn''t >> urls generated from the child controller default to the child >> controller rather than the parent, and if so, why wouldn''t render >> work the same way? Is there any formal way for me to understand >> Rails'' behavior here? >> >> On Mar 18, 2006, at 5:10 PM, Emin Hasanov wrote: >> >>> if you want to have a hard-link that does not depend on external >>> call, you would have hard-coded controller name >>> >>> not sure why you don''t like that idea >>> >>> On 3/19/06, Andrew Greenberg < werdna@mucow.com> wrote: >>> I have a lovely web-application, under controller "Child", and would >>> like to "include" it in a page under another application having >>> controller "Parent." The natural way to do this, I would have >>> thought, would be to incorporate it in one of Parent''s views using >>> render_component, thus: >>> >>> <%= render_component :controller => "Child", :action => >>> "foo" %> >>> >>> ----- >>> >>> So far, so good. The page appears to render wonderfully in the >>> parent app, just as I intended. My problem is that internal links >>> and more important, Ajax urls on that page, generated by the view in >>> child/view/foo.rhtml comes from code like the following: >>> >>> <%= link_to :action => "bar1" %> >>> .... >>> <%= form_remote_tag :url => { :action => "bar2"} . . . >>> .... >>> <%= link_to_remote :action => "bar2" %> >>> >>> and the like. >>> >>> ----- >>> >>> The links, when running from a call to " http://localhost:3000/ >>> child/ >>> foo", properly generate links to the corresponding portions of >>> Child, >>> generating urls like: >>> >>> child/bar1 >>> child/bar2 >>> child/bar3 >>> >>> but when running under Parent, using the "render_component" >>> generates >>> >>> parent/bar1 >>> parent/bar2 >>> parent/bar3 >>> >>> which is not inconsistent with the documentation, but inconsistent >>> with my intent. Particularly when trying to componentize an Ajax >>> application, this is a disappointing result, as I was hoping to >>> encapsulate the internal portions of, in this case, a form editor. >>> >>> One solution, of course, is to simply rewrite the sub-app with every >>> link_to, form_remote_tag and link_to_remote having a hard- >>> coded :controller parm, but is that the Rails way? Is there a >>> better, simpler way to accomplish what I desire? >>> >>> Thanks for your time and thoughts. >>> >>> _______________________________________________ >>> Rails mailing list >>> Rails@lists.rubyonrails.org >>> http://lists.rubyonrails.org/mailman/listinfo/rails >>> >>> _______________________________________________ >>> Rails mailing list >>> Rails@lists.rubyonrails.org >>> http://lists.rubyonrails.org/mailman/listinfo/rails >> >> >> _______________________________________________ >> Rails mailing list >> Rails@lists.rubyonrails.org >> http://lists.rubyonrails.org/mailman/listinfo/rails >> >> >> >> _______________________________________________ >> Rails mailing list >> Rails@lists.rubyonrails.org >> http://lists.rubyonrails.org/mailman/listinfo/rails > > > _______________________________________________ > Rails mailing list > Rails@lists.rubyonrails.org > http://lists.rubyonrails.org/mailman/listinfo/rails > > > > _______________________________________________ > Rails mailing list > Rails@lists.rubyonrails.org > http://lists.rubyonrails.org/mailman/listinfo/rails-------------- next part -------------- An HTML attachment was scrubbed... URL: http://wrath.rubyonrails.org/pipermail/rails/attachments/20060323/c8f75c1d/attachment.html
render partial will use current controller to locate template if you don''t specify anything when you get to render command, you are now in the "child" controller because this is what you called by render_component on the other hand, link_to and form_tag use current request instead of current controller and this is where the difference comes from... you will get used to this - default values are what you need most of the time :-) On 3/22/06, Andrew Greenberg <werdna@mucow.com> wrote:> > I am not sure I am being clear, based on your response. Controller parent > has an action, say index, and index.rhtml, its view, includes the > following command: > . . . . > render_component :controller => "Child" :action => "foo" > . . . . > > and foo has a view including the following in views/child/foo.rhtml: > > . . . . > link_remote_to :action => "bar1" . . . > . . . . > form_remote_tag :action => "bar2" . . . > . . . . > render :partial=>"bar3" . . . > . . . . > > The partial generates the partial specified in "shmoo.rhtml" in the CHILD > directory, but the link_remote_to generates a link to " > http:/mydomain.com/parent/bar1" and the form_remote_tag generates a call > upon submission to "http://mydomain.com/parent/bar2" > > It still seems confusing to me, although I think I am beginning to "feel" > ok about it at end. > > On Mar 20, 2006, at 2:34 AM, Emin Hasanov wrote: > > rendering is completely different story and is based on actions not > controllers, therefore if you don''t specify anything it will use current > action > > On 3/20/06, Andrew Greenberg <werdna@mucow.com> wrote: > > > > Thanks so very much. I get it now, and it makes sense. > > why do the render commands work differently? > > > > On Mar 19, 2006, at 1:49 PM, Emin Hasanov wrote: > > > > This is just the way it is done, though not exactly like you said. > > > > http://api.rubyonrails.com/classes/ActionController/Base.html#M000174 > > "When generating a new URL, missing values may be filled in from the > > current request''s parameters." > > Note, it says current request, not calling/called controller > > > > Nothing stops you from overwriting this function and using your own > > approach > > > > > > On 3/19/06, Andrew Greenberg < werdna@mucow.com> wrote: > > > > > > That will work, but I still don''t understand what is happening here. > > > While the link_to, form_remote_tag and link_to_remote routines all use > > > the CALLING controller, Parent, other code in the view, in particular render > > > commands use the CALLED component controller, Child! Isn''t this behavior > > > strange or inconsistent? Why doesn''t urls generated from the child > > > controller default to the child controller rather than the parent, and if > > > so, why wouldn''t render work the same way? Is there any formal way for me > > > to understand Rails'' behavior here? > > > > > > On Mar 18, 2006, at 5:10 PM, Emin Hasanov wrote: > > > > > > if you want to have a hard-link that does not depend on external call, > > > you would have hard-coded controller name > > > > > > not sure why you don''t like that idea > > > > > > On 3/19/06, Andrew Greenberg < werdna@mucow.com> wrote: > > > > > > > > I have a lovely web-application, under controller "Child", and would > > > > > > > > like to "include" it in a page under another application having > > > > controller "Parent." The natural way to do this, I would have > > > > thought, would be to incorporate it in one of Parent''s views using > > > > render_component, thus: > > > > > > > > <%= render_component :controller => "Child", :action => > > > > "foo" %> > > > > > > > > ----- > > > > > > > > So far, so good. The page appears to render wonderfully in the > > > > parent app, just as I intended. My problem is that internal links > > > > and more important, Ajax urls on that page, generated by the view in > > > > child/view/foo.rhtml comes from code like the following: > > > > > > > > <%= link_to :action => "bar1" %> > > > > .... > > > > <%= form_remote_tag :url => { :action => "bar2"} . . . > > > > .... > > > > <%= link_to_remote :action => "bar2" %> > > > > > > > > and the like. > > > > > > > > ----- > > > > > > > > The links, when running from a call to " http://localhost:3000/child/ > > > > > > > > foo", properly generate links to the corresponding portions of > > > > Child, > > > > generating urls like: > > > > > > > > child/bar1 > > > > child/bar2 > > > > child/bar3 > > > > > > > > but when running under Parent, using the "render_component" > > > > generates > > > > > > > > parent/bar1 > > > > parent/bar2 > > > > parent/bar3 > > > > > > > > which is not inconsistent with the documentation, but inconsistent > > > > with my intent. Particularly when trying to componentize an Ajax > > > > application, this is a disappointing result, as I was hoping to > > > > encapsulate the internal portions of, in this case, a form editor. > > > > > > > > One solution, of course, is to simply rewrite the sub-app with every > > > > link_to, form_remote_tag and link_to_remote having a hard- > > > > coded :controller parm, but is that the Rails way? Is there a > > > > better, simpler way to accomplish what I desire? > > > > > > > > Thanks for your time and thoughts. > > > > > > > > _______________________________________________ > > > > Rails mailing list > > > > Rails@lists.rubyonrails.org > > > > http://lists.rubyonrails.org/mailman/listinfo/rails > > > > > > > > > > _______________________________________________ > > > Rails mailing list > > > Rails@lists.rubyonrails.org > > > http://lists.rubyonrails.org/mailman/listinfo/rails > > > > > > > > > > > > _______________________________________________ > > > Rails mailing list > > > Rails@lists.rubyonrails.org > > > http://lists.rubyonrails.org/mailman/listinfo/rails > > > > > > > > > > > _______________________________________________ > > Rails mailing list > > Rails@lists.rubyonrails.org > > http://lists.rubyonrails.org/mailman/listinfo/rails > > > > > > > > _______________________________________________ > > Rails mailing list > > Rails@lists.rubyonrails.org > > http://lists.rubyonrails.org/mailman/listinfo/rails > > > > > > > _______________________________________________ > Rails mailing list > Rails@lists.rubyonrails.org > http://lists.rubyonrails.org/mailman/listinfo/rails > > > > _______________________________________________ > Rails mailing list > Rails@lists.rubyonrails.org > http://lists.rubyonrails.org/mailman/listinfo/rails > > >-------------- next part -------------- An HTML attachment was scrubbed... URL: http://wrath.rubyonrails.org/pipermail/rails/attachments/20060323/e8e5c4c8/attachment-0001.html
This works but you must remove the /* and you will more than likely need to issue it as a super user. so it should be: sudo ln -s universal-darwin8.0 powerpc-darwin8.0 great idea though! Paul Robinson wrote:> On 18 Mar 2006, at 21:28, Oskar wrote: > >> I''m trying now to do "sudo fixrbconfig" in the terminal, and I get >> this: >> >> /usr/lib/ruby/1.8/powerpc-darwin8.0/ruby.h does not exist. This >> probably means you haven''t yet installed Xcode from the Tiger DVD. >> You >> won''t be able to compile Ruby extensions without it. Please install it >> then rerun this program. >> >> I''m on an intel mac. Am I unable to use fixrbconfig? > > The clue is in the path it''s looking for ruby.h - it''s hard-coded for > looking in the powerpc-darwin8.0 directory, which I''m guessing won''t > exist on an Intel architecture machine for obvious reasons. :-) > > Try doing this on the command line > > cd /usr/lib/ruby/1.8/ > ln -s universal-darwin8.0/* powerpc-darwin8.0 > > Then try again. Hope that fixes it for you. > > -- > Paul Robinson-- Posted via http://www.ruby-forum.com/. --~--~---------~--~----~------------~-------~--~----~ You received this message because you are subscribed to the Google Groups "Ruby on Rails: Talk" group. To post to this group, send email to rubyonrails-talk-/JYPxA39Uh5TLH3MbocFFw@public.gmane.org To unsubscribe from this group, send email to rubyonrails-talk-unsubscribe-/JYPxA39Uh5TLH3MbocFFw@public.gmane.org For more options, visit this group at http://groups.google.com/group/rubyonrails-talk?hl=en -~----------~----~----~----~------~----~------~--~---