19 Feb 2012 17:47
Re: Camping Multimount
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.
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-N9AOi2cAC9ZBDgjK7y7TUQ@public.gmane.org> 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-Re5JQEeQqe8AvxtiuMwx3w@public.gmane.org> wrote:
>
>> On Fri, Feb 17, 2012 at 22:13, Isak Andersson <IcePapih-N9AOi2cAC9ZBDgjK7y7TUQ@public.gmane.org>
>> 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
>>> pub lic/
>>> 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 t hen 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 l inking 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-GrnCvJ7WPxnNLxjTenLetw@public.gmane.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-GrnCvJ7WPxnNLxjTenLetw@public.gmane.org
> http://rubyforge.org/mailman/listinfo/camping-list
--
Dave
Camping-list mailing list
Camping-list-GrnCvJ7WPxnNLxjTenLetw@public.gmane.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/
_______________________________________________ Camping-list mailing list Camping-list@... http://rubyforge.org/mailman/listinfo/camping-list
RSS Feed