Hi, sorry if I''m repeating is email or something, Cinnamon crashed as I was sending the mail and the result in the sent folder was completely empty, so I''m just gonna have to write it all over again, wee! Anyways, my question was about new camping and if we still have the ability to mount multiple smaller apps as the bigger app. I''m creating an app to host my blog and a bunch of other stuff using the new Camping version that comes with Mab + Riak. I want to be able to divide each part of the website into it''s own app, but I still want them to share some things, like the public/ folder so that they have the same look. I also want them to share Riak node which they will do. Let''s say that my project structure looks something like this app/ app.rb blog.rb forum.rb # Not actually having a forum though, probably public/ Style.css Coolpic.png blog/ controllers.rb views.rb forum/ controllers.rb views.rb config/ ripple.yml foo.yml First off, what is the correct command to mount these parts, and how does it work? The Camping site says: camping apps/**/*.rb. I''m not sure what it does though, and if it would still work in the new version. One thing that I would like, would be if all sub-apps for app.rb like blog or forum inherited some of the settings of app.rb. I''m using rack_csrf for csrf protection (obviously) and I find it kind of strange to have to set it up for each and every app instead of just app.rb. Another thing, how do I make app.rb the root of the entire site so it''s mounted at foobar.com and not foobar.com/blog like the other ones should be mounted. Also, how do I link between the different apps? Like how do I make app link to the blog or a part of the forum link to a certain part of app? I guess that was all the questions I had about this. I''m starting to feel like this would be the ultimate way to build a larger Camping app :) Cheers! -Isak Andersson
On Fri, Feb 17, 2012 at 22:13, Isak Andersson <IcePapih at lavabit.com> wrote:> Hi, sorry if I''m repeating is email or something, Cinnamon crashed as I was > sending the mail and > the result in the sent folder was completely empty, so I''m just gonna have > to write it all over > again, wee! > > Anyways, my question was about new camping and if we still have the ability > to mount multiple smaller > apps as the bigger app. I''m creating an app to host my blog and a bunch of > other stuff using the new > Camping version that comes with Mab + Riak. I want to be able to divide each > part of the website into > it''s own app, but I still want them to share some things, like the public/ > folder so that they have the > same look. I also want them to share Riak node which they will do. > > Let''s say that my project structure looks something like this > > app/ > ? ? ? ?app.rb > ? ? ? ?blog.rb > ? ? ? ?forum.rb ? ? ? ?# Not actually having a forum though, probably > ? ? ? ?public/ > ? ? ? ? ? ? ? ?Style.css > ? ? ? ? ? ? ? ?Coolpic.png > ? ? ? ?blog/ > ? ? ? ? ? ? ? ?controllers.rb > ? ? ? ? ? ? ? ?views.rb > ? ? ? ?forum/ > ? ? ? ? ? ? ? ?controllers.rb > ? ? ? ? ? ? ? ?views.rb > ? ? ? ?config/ > ? ? ? ? ? ? ? ?ripple.yml > ? ? ? ? ? ? ? ?foo.yml > > First off, what is the correct command to mount these parts, and how does it > work? The Camping site says: > camping apps/**/*.rb. > > I''m not sure what it does though, and if it would still work in the new > version.In the newest (pre-release) version of Camping you solve this by using a config.ru-file: # in config.ru require ''app'' require ''blog'' require ''forum'' map ''/'' do run App end map ''/blog'' do run Blog end map ''/forum'' do run Forum end You can then run `camping config.ru` to start the server.> One thing that I would like, would be if all sub-apps for app.rb like blog > or forum inherited some of the > settings of app.rb. I''m using rack_csrf for csrf protection (obviously) and > I find it kind of strange to have to set > it up for each and every app instead of just app.rb.The simplest solution is to define something like this: def App.setup(app) app.class_eval do set :foo, 123 include Bar use Baz end end And then: module App App.setup(self) end module Blog App.setup(self) end module Forum App.setup(self) end> > Another thing, how do I make app.rb the root of the entire site so it''s > mounted at foobar.com and not > foobar.com/blog like the other ones should be mounted. Also, how do I link > between the different apps? > Like how do I make app link to the blog or a part of the forum link to a > certain part of app?Linking is indeed a hard problem. By default, Camping+Mab prepends the mount path to all links. So if you generate "/user/1" inside a Forum-template, the link will actually come out as "/forum/user/1". Of course, this means that linking to "/blog/post/1" does actually link to "/forum/blog/post/1" which probably wasn''t what you intended. I''m really not sure what''s the best solution is here?> I guess that was all the questions I had about this. I''m starting to feel > like this would be the ultimate > way to build a larger Camping app :) >Have fun :D
All very nice solutions I must say. I started using Rails (oh no!) to build the app since it would be easier to handle bigger things since I couldn''t figure this out. This is amazing though. Since I''m still not sure how I''d handle the linking I think I''ll keep using rails for this particular app
Actually no, if we solve this whole little thing about linking I''ll just swap it all back to camping for the 12382th time! Because I''m just loving this! On Sat, 18 Feb 2012 21:35:39 +0100, Magnus Holm <judofyr at gmail.com> wrote:> On Fri, Feb 17, 2012 at 22:13, Isak Andersson <IcePapih at lavabit.com> > wrote: >> Hi, sorry if I''m repeating is email or something, Cinnamon crashed as I >> was >> sending the mail and >> the result in the sent folder was completely empty, so I''m just gonna >> have >> to write it all over >> again, wee! >> >> Anyways, my question was about new camping and if we still have the >> ability >> to mount multiple smaller >> apps as the bigger app. I''m creating an app to host my blog and a bunch >> of >> other stuff using the new >> Camping version that comes with Mab + Riak. I want to be able to divide >> each >> part of the website into >> it''s own app, but I still want them to share some things, like the >> public/ >> folder so that they have the >> same look. I also want them to share Riak node which they will do. >> >> Let''s say that my project structure looks something like this >> >> app/ >> app.rb >> blog.rb >> forum.rb # Not actually having a forum though, probably >> public/ >> Style.css >> Coolpic.png >> blog/ >> controllers.rb >> views.rb >> forum/ >> controllers.rb >> views.rb >> config/ >> ripple.yml >> foo.yml >> >> First off, what is the correct command to mount these parts, and how >> does it >> work? The Camping site says: >> camping apps/**/*.rb. >> >> I''m not sure what it does though, and if it would still work in the new >> version. > > In the newest (pre-release) version of Camping you solve this by using > a config.ru-file: > > # in config.ru > require ''app'' > require ''blog'' > require ''forum'' > > map ''/'' do > run App > end > > map ''/blog'' do > run Blog > end > > map ''/forum'' do > run Forum > end > > You can then run `camping config.ru` to start the server. > >> One thing that I would like, would be if all sub-apps for app.rb like >> blog >> or forum inherited some of the >> settings of app.rb. I''m using rack_csrf for csrf protection (obviously) >> and >> I find it kind of strange to have to set >> it up for each and every app instead of just app.rb. > > The simplest solution is to define something like this: > > def App.setup(app) > app.class_eval do > set :foo, 123 > include Bar > use Baz > end > end > > And then: > > module App > App.setup(self) > end > > module Blog > App.setup(self) > end > > module Forum > App.setup(self) > end > >> >> Another thing, how do I make app.rb the root of the entire site so it''s >> mounted at foobar.com and not >> foobar.com/blog like the other ones should be mounted. Also, how do I >> link >> between the different apps? >> Like how do I make app link to the blog or a part of the forum link to a >> certain part of app? > > Linking is indeed a hard problem. By default, Camping+Mab prepends the > mount path to all links. So if you generate "/user/1" inside a > Forum-template, the link will actually come out as "/forum/user/1". Of > course, this means that linking to "/blog/post/1" does actually link > to "/forum/blog/post/1" which probably wasn''t what you intended. > > I''m really not sure what''s the best solution is here? > >> I guess that was all the questions I had about this. I''m starting to >> feel >> like this would be the ultimate >> way to build a larger Camping app :) >> > > Have fun :D > _______________________________________________ > Camping-list mailing list > Camping-list at rubyforge.org > http://rubyforge.org/mailman/listinfo/camping-list > ____________________________________________________________________________________ > Delivering best online results. Get better, different Relevant results > fast ! > Searching the best of online online. > http://click.lavabit.com/4ehcpqntnpwdsxdqu4axg6a3o453mwgxeoghwyzarmthtqqeyhwb/ > ____________________________________________________________________________________-- Using Opera''s revolutionary email client: http://www.opera.com/mail/
http://pastebin.com/JuHhW0Ri Not sure what went wrong there :/ The app is over here https://github.com/MilkshakePanda/Penguin I have no idea what that had to do with my config.ru file.. On Sat, 18 Feb 2012 21:35:39 +0100, Magnus Holm <judofyr at gmail.com> wrote:> On Fri, Feb 17, 2012 at 22:13, Isak Andersson <IcePapih at lavabit.com> > wrote: >> Hi, sorry if I''m repeating is email or something, Cinnamon crashed as I >> was >> sending the mail and >> the result in the sent folder was completely empty, so I''m just gonna >> have >> to write it all over >> again, wee! >> >> Anyways, my question was about new camping and if we still have the >> ability >> to mount multiple smaller >> apps as the bigger app. I''m creating an app to host my blog and a bunch >> of >> other stuff using the new >> Camping version that comes with Mab + Riak. I want to be able to divide >> each >> part of the website into >> it''s own app, but I still want them to share some things, like the >> public/ >> folder so that they have the >> same look. I also want them to share Riak node which they will do. >> >> Let''s say that my project structure looks something like this >> >> app/ >> app.rb >> blog.rb >> forum.rb # Not actually having a forum though, probably >> public/ >> Style.css >> Coolpic.png >> blog/ >> controllers.rb >> views.rb >> forum/ >> controllers.rb >> views.rb >> config/ >> ripple.yml >> foo.yml >> >> First off, what is the correct command to mount these parts, and how >> does it >> work? The Camping site says: >> camping apps/**/*.rb. >> >> I''m not sure what it does though, and if it would still work in the new >> version. > > In the newest (pre-release) version of Camping you solve this by using > a config.ru-file: > > # in config.ru > require ''app'' > require ''blog'' > require ''forum'' > > map ''/'' do > run App > end > > map ''/blog'' do > run Blog > end > > map ''/forum'' do > run Forum > end > > You can then run `camping config.ru` to start the server. > >> One thing that I would like, would be if all sub-apps for app.rb like >> blog >> or forum inherited some of the >> settings of app.rb. I''m using rack_csrf for csrf protection (obviously) >> and >> I find it kind of strange to have to set >> it up for each and every app instead of just app.rb. > > The simplest solution is to define something like this: > > def App.setup(app) > app.class_eval do > set :foo, 123 > include Bar > use Baz > end > end > > And then: > > module App > App.setup(self) > end > > module Blog > App.setup(self) > end > > module Forum > App.setup(self) > end > >> >> Another thing, how do I make app.rb the root of the entire site so it''s >> mounted at foobar.com and not >> foobar.com/blog like the other ones should be mounted. Also, how do I >> link >> between the different apps? >> Like how do I make app link to the blog or a part of the forum link to a >> certain part of app? > > Linking is indeed a hard problem. By default, Camping+Mab prepends the > mount path to all links. So if you generate "/user/1" inside a > Forum-template, the link will actually come out as "/forum/user/1". Of > course, this means that linking to "/blog/post/1" does actually link > to "/forum/blog/post/1" which probably wasn''t what you intended. > > I''m really not sure what''s the best solution is here? > >> I guess that was all the questions I had about this. I''m starting to >> feel >> like this would be the ultimate >> way to build a larger Camping app :) >> > > Have fun :D > _______________________________________________ > Camping-list mailing list > Camping-list at rubyforge.org > http://rubyforge.org/mailman/listinfo/camping-list > ____________________________________________________________________________________ > Delivering best online results. Get better, different Relevant results > fast ! > Searching the best of online online. > http://click.lavabit.com/4ehcpqntnpwdsxdqu4axg6a3o453mwgxeoghwyzarmthtqqeyhwb/ > ____________________________________________________________________________________-- Using Opera''s revolutionary email client: http://www.opera.com/mail/
On the linking thing, could you invoke a method in the main app from a sub-app which takes a sub-app name and a route as variables? The method could then just return R() from the appropriate sub-app. Dave On Sat, Feb 18, 2012 at 4:55 PM, Isak Andersson <IcePapih at lavabit.com> wrote:> http://pastebin.com/JuHhW0R > > Not sure what went wrong there :/ > > The app is over here https://github.com/MilkshakePanda/Penguin > > I have no idea what that had to do with my config.ru file.. > > > > On Sat, 18 Feb 2012 21:35:39 +0100, Magnus Holm <judofyr at gmail.com> wrote: > >> On Fri, Feb 17, 2012 at 22:13, Isak Andersson <IcePapih at lavabit.com> >> wrote: >>> >>> Hi, sorry if I''m repeating is email or something, Cinnamon crashed as I >>> was >>> sending the mail and >>> the result in the sent folder was completely empty, so I''m just gonna >>> have >>> to write it all over >>> again, wee! >>> >>> Anyways, my question was about new camping and if we still have the >>> ability >>> to mount multiple smaller >>> apps as the bigger app. I''m creating an app to host my blog and a bunch >>> of >>> other stuff using the new >>> Camping version that comes with Mab + Riak. I want to be able to divide >>> each >>> part of the website into >>> it''s own app, but I still want them to share some things, like the >>> public/ >>> folder so that they have the >>> same look. I also want them to share Riak node which they will do. >>> >>> Let''s say that my project structure looks something like this >>> >>> app/ >>> ? ? ? app.rb >>> ? ? ? blog.rb >>> ? ? ? forum.rb ? ? ? ?# Not actually having a forum though, probably >>> ? ? ? public/ >>> ? ? ? ? ? ? ? Style.css >>> ? ? ? ? ? ? ? Coolpic.png >>> ? ? ? blog/ >>> ? ? ? ? ? ? ? controllers.rb >>> ? ? ? ? ? ? ? views.rb >>> ? ? ? forum/ >>> ? ? ? ? ? ? ? controllers.rb >>> ? ? ? ? ? ? ? views.rb >>> ? ? ? config/ >>> ? ? ? ? ? ? ? ripple.yml >>> ? ? ? ? ? ? ? foo.yml >>> >>> First off, what is the correct command to mount these parts, and how does >>> it >>> work? The Camping site says: >>> camping apps/**/*.rb. >>> >>> I''m not sure what it does though, and if it would still work in the new >>> version. >> >> >> In the newest (pre-release) version of Camping you solve this by using >> a config.ru-file: >> >> ?# in config.ru >> ?require ''app'' >> ?require ''blog'' >> ?require ''forum'' >> >> ?map ''/'' do >> ? ?run App >> ?end >> >> ?map ''/blog'' do >> ? ?run Blog >> ?end >> >> ?map ''/forum'' do >> ? ?run Forum >> ?end >> >> You can then run `camping config.ru` to start the server. >> >>> One thing that I would like, would be if all sub-apps for app.rb like >>> blog >>> or forum inherited some of the >>> settings of app.rb. I''m using rack_csrf for csrf protection (obviously) >>> and >>> I find it kind of strange to have to set >>> it up for each and every app instead of just app.rb. >> >> >> The simplest solution is to define something like this: >> >> ?def App.setup(app) >> ? ?app.class_eval do >> ? ? ?set :foo, 123 >> ? ? ?include Bar >> ? ? ?use Baz >> ? ?end >> ?end >> >> And then: >> >> ?module App >> ? ?App.setup(self) >> ?end >> >> ?module Blog >> ? ?App.setup(self) >> ?end >> >> ?module Forum >> ? ?App.setup(self) >> ?end >> >>> >>> Another thing, how do I make app.rb the root of the entire site so it''s >>> mounted at foobar.com and not >>> foobar.com/blog like the other ones should be mounted. Also, how do I >>> link >>> between the different apps? >>> Like how do I make app link to the blog or a part of the forum link to a >>> certain part of app? >> >> >> Linking is indeed a hard problem. By default, Camping+Mab prepends the >> mount path to all links. So if you generate "/user/1" inside a >> Forum-template, the link will actually come out as "/forum/user/1". Of >> course, this means that linking to "/blog/post/1" does actually link >> to "/forum/blog/post/1" which probably wasn''t what you intended. >> >> I''m really not sure what''s the best solution is here? >> >>> I guess that was all the questions I had about this. I''m starting to feel >>> like this would be the ultimate >>> way to build a larger Camping app :) >>> >> >> Have fun :D >> _______________________________________________ >> Camping-list mailing list >> Camping-list at rubyforge.org >> http://rubyforge.org/mailman/listinfo/camping-list >> >> ____________________________________________________________________________________ >> Delivering best online results. Get better, different Relevant results >> fast ! >> Searching the best of online online. >> >> http://click.lavabit.com/4ehcpqntnpwdsxdqu4axg6a3o453mwgxeoghwyzarmthtqqeyhwb/ >> >> ____________________________________________________________________________________ > > > > -- > Using Opera''s revolutionary email client: http://www.opera.com/mail/ > > _______________________________________________ > Camping-list mailing list > Camping-list at rubyforge.org > http://rubyforge.org/mailman/listinfo/camping-list-- Dave
Well, wouldn''t you have to be in the main app for that to work? The linking should be global. The ultimate thing would be if R could take another parameter for which app to use R in. It would check with the config.du file and see how it is mounted and generate a link from that. Something like R(Show, 23), :app => :blog. That functionality is hard to add outside of Camping though.. -- Skickat fr?n min Android-telefon med K-9 E-post. Urs?kta min f?ordighet. David Susco <dsusco at gmail.com> skrev: On the linking thing, could you invoke a method in the main app from a sub-app which takes a sub-app name and a route as variables? The method could then just return R() from the appropriate sub-app. Dave On Sat, Feb 18, 2012 at 4:55 PM, Isak Andersson <IcePapih at lavabit.com> wrote:> http://pastebin.com/JuHhW0R > > Not sure what went wrong there :/ > > The app is over here https://github.com/MilkshakePanda/Penguin > > I have no idea what that had to do with my config.ru file.. > > > > On Sat, 18 Feb 2012 21:35:39 +0100, Magnus Holm <judofyr at gmail.com> wrote: > >> On Fri, Feb 17, 2012 at 22:13, Isak Andersson <IcePapih at lavabit.com> >> wrote: >>> >>> Hi, sorry if I''m repeating is email or something, Cinnamon crashed as I >>> was >>> sending the mail and >>> the result in the sent folder was completely empty, so I''m just gonna >>> have >>> to write it all over >>> again, wee! >>> >>> Anyways, my question was about new camping and if we still have the >>> ability >>> to mount multiple smaller >>> apps as the bigger app. I''m creating an app to host my blog and a bunch >>> of >>> other stuff using the new >>> Camping version that comes with Mab + Riak. I want to be able to divide >>> each >>> part of the website into >>> it''s own app, but I still want them to share some things, like the >>> public/ >>> folder so that they have the >>> same look. I also want them to share Riak node which they will do. >>> >>> Let''s say that my project structure looks something like this >>> >>> app/ >>> app.rb >>> blog.rb >>> forum.rb # Not actually having a forum though, probably >>> public/ >>> Style.css >>> Coolpic.png >>> blog/ >>> controllers.rb >>> views.rb >>> forum/ >>> controllers.rb >>> views.rb >>> config/ >>> ripple.yml >>> foo.yml >>> >>> First off, what is the correct command to mount these parts, and how does >>> it >>> work? The Camping site says: >>> camping apps/**/*.rb. >>> >>> I''m not sure what it does though, and if it would still work in the new >>> version. >> >> >> In the newest (pre-release) version of Camping you solve this by using >> a config.ru-file: >> >> # in config.ru >> require ''app'' >> require ''blog'' >> require ''forum'' >> >> map ''/'' do >> run App >> end >> >> map ''/blog'' do >> run Blog >> end >> >> map ''/forum'' do >> run Forum >> end >> >> You can then run `camping config.ru` to start the server. >> >>> One thing that I would like, would be if all sub-apps for app.rb like >>> blog >>> or forum inherited some of the >>> settings of app.rb. I''m using rack_csrf for csrf protection (obviously) >>> and >>> I find it kind of strange to have to set >>> it up for each and every app instead of just app.rb. >> >> >> The simplest solution is to define something like this: >> >> def App.setup(app) >> app.class_eval do >> set :foo, 123 >> include Bar >> use Baz >> end >> end >> >> And then: >> >> module App >> App.setup(self) >> end >> >> module Blog >> App.setup(self) >> end >> >> module Forum >> App.setup(self) >> end >> >>> >>> Another thing, how do I make app.rb the root of the entire site so it''s >>> mounted at foobar.com and not >>> foobar.com/blog like the other ones should be mounted. Also, how do I >>> link >>> between the different apps? >>> Like how do I make app link to the blog or a part of the forum link to a >>> certain part of app? >> >> >> Linking is indeed a hard problem. By default, Camping+Mab prepends the >> mount path to all links. So if you generate "/user/1" inside a >> Forum-template, the link will actually come out as "/forum/user/1". Of >> course, this means that linking to "/blog/post/1" does actually link >> to "/forum/blog/post/1" which probably wasn''t what you intended. >> >> I''m really not sure what''s the best solution is here? >> >>> I guess that was all the questions I had about this. I''m starting to feel >>> like this would be the ultimate >>> way to build a larger Camping app :) >>> >> >> Have fun :D >>_____________________________________________>> Camping-list mailing list >> Camping-list at rubyforge.org >> http://rubyforge.org/mailman/listinfo/camping-list >> >>_____________________________________________>> Delivering best online results. Get better, different Relevant results >> fast ! >> Searching the best of online online. >> >> http://click.lavabit.com/4ehcpqntnpwdsxdqu4axg6a3o453mwgxeoghwyzarmthtqqeyhwb/ >> >>_____________________________________________> > > > -- > Using Opera''s revolutionary email client: http://www.opera.com/mail/ > >_____________________________________________> Camping-list mailing list > Camping-list at rubyforge.org > http://rubyforge.org/mailman/listinfo/camping-list-- Dave _____________________________________________ Camping-list mailing list Camping-list at rubyforge.org http://rubyforge.org/mailman/listinfo/camping-list _____________________________________________ Delivering best marina jobs results. Get better, different Relevant results fast ! Searching the best of marina jobs online. http://click.lavabit.com/fab8qbmqz161en3o5m4djycm7afdab9k87krkjzbeo5nzwcyhiby/ _____________________________________________ -------------- next part -------------- An HTML attachment was scrubbed... URL: <http://rubyforge.org/pipermail/camping-list/attachments/20120219/e1726f2f/attachment-0001.html>