Gmail Calendar Documents Reader Web more »
Recently Visited Groups | Help | Sign in
Google Groups Home
Using SproutCore Server with another server
There are currently too many topics in this group that display first. To make this topic appear first, remove this option from another topic.
There was an error processing your request. Please try again.
flag
  7 messages - Expand all  -  Translate all to Translated (View all originals)
The group you are posting to is a Usenet group. Messages posted to this group will make your email address visible to anyone on the Internet.
Your reply message has not been sent.
Your post was successful
 
From:
To:
Cc:
Followup To:
Add Cc | Add Followup-to | Edit Subject
Subject:
Validation:
For verification purposes please type the characters you see in the picture below or the numbers you hear by clicking the accessibility icon. Listen and type the numbers you hear
 
jewetz  
View profile  
 More options Jun 19 2008, 9:39 am
From: jewetz <jens.we...@gmail.com>
Date: Thu, 19 Jun 2008 06:39:47 -0700 (PDT)
Local: Thurs, Jun 19 2008 9:39 am
Subject: Using SproutCore Server with another server
Hello!

I want to write a WebApp using SproutCore for the client side and PHP
for the backend. Right now I have the sc-server running for the client
and a webserver (on the same machine, just a different port) for the
PHP stuff. This is all very well until I want to use AJAX to get data
from the backend.

AJAX requests only work on the same host and port, so I need a way to
run both on the same server. Either PHP through sc-server (probably
not possible) or my client stuff on the web server.

What I do at the moment is sc-build every time I change something on
the front end (and then I have to manually change paths because
SproutCore wants its files at http://localhost/static/... and the
actual files are in http://localhost/subfolders/static/...), so that's
very inconvenient.

Is there any way I can do this more efficiently?

Regards,
Jens


    Reply to author    Forward  
You must Sign in before you can post messages.
To post a message you must first join this group.
Please update your nickname on the subscription settings page before posting.
You do not have the permission required to post.
Dan  
View profile  
 More options Jun 19 2008, 9:50 am
From: Dan <dan.rolan...@gmail.com>
Date: Thu, 19 Jun 2008 06:50:48 -0700 (PDT)
Local: Thurs, Jun 19 2008 9:50 am
Subject: Re: Using SproutCore Server with another server
Does this help?

Mixing the Build Tools with Your Backend Server
http://www.sproutcore.com/documentation/topics/sproutcore-build-tools/

On Jun 19, 9:39 am, jewetz <jens.we...@gmail.com> wrote:


    Reply to author    Forward  
You must Sign in before you can post messages.
To post a message you must first join this group.
Please update your nickname on the subscription settings page before posting.
You do not have the permission required to post.
Jolle Carlestam  
View profile  
 More options Jun 19 2008, 9:57 am
From: Jolle Carlestam <jo...@carlestam.com>
Date: Thu, 19 Jun 2008 15:57:54 +0200
Local: Thurs, Jun 19 2008 9:57 am
Subject: Re: [sproutcore] Using SproutCore Server with another server
Sproutcore doesn't "want" files at http://localhost/static/. It puts  
them there because you told it to.
Take a look at the settings document sc-config.rb. It controls where  
files are placed after a build. Change
   c[:resources_at] = 'static'
to what ever you want.

HDB
Jolle

19 jun 2008 kl. 15.39 skrev jewetz:


    Reply to author    Forward  
You must Sign in before you can post messages.
To post a message you must first join this group.
Please update your nickname on the subscription settings page before posting.
You do not have the permission required to post.
jewetz  
View profile  
 More options Jun 19 2008, 10:50 am
From: jewetz <jens.we...@gmail.com>
Date: Thu, 19 Jun 2008 07:50:03 -0700 (PDT)
Local: Thurs, Jun 19 2008 10:50 am
Subject: Re: Using SproutCore Server with another server
Thanks to both of you, that's perfect!

I have another question about paths: In my CSS files, how do I
reference an image in my english.lproj folder (that's where shared
resources are supposed to be, right?) correctly so that it shows up
while testing with sc-server and also when I build the project.


    Reply to author    Forward  
You must Sign in before you can post messages.
To post a message you must first join this group.
Please update your nickname on the subscription settings page before posting.
You do not have the permission required to post.
Erich Ocean  
View profile  
 More options Jun 19 2008, 10:55 am
From: Erich Ocean <er...@atlasocean.com>
Date: Thu, 19 Jun 2008 07:55:39 -0700
Local: Thurs, Jun 19 2008 10:55 am
Subject: Re: [sproutcore] Re: Using SproutCore Server with another server
I believe the syntax is:

        static_url('my_image.png')

For example, this could go in your body.rhtml, it looks like this (a  
ruby method call):

        <img src="<%= static_url('my_image.png') %>" />

You can also use it in .css files, like this:

   background: static_url('bottom_border.png') repeat-x bottom left;

In that case, it's handled by SproutCore's build tools.

Best, Erich

On Jun 19, 2008, at 7:50 AM, jewetz wrote:


    Reply to author    Forward  
You must Sign in before you can post messages.
To post a message you must first join this group.
Please update your nickname on the subscription settings page before posting.
You do not have the permission required to post.
Charles Jolley  
View profile  
 More options Jun 19 2008, 11:15 am
From: Charles Jolley <char...@sproutit.com>
Date: Thu, 19 Jun 2008 08:15:15 -0700
Local: Thurs, Jun 19 2008 11:15 am
Subject: Re: [sproutcore] Re: Using SproutCore Server with another server
Erich is right.  static_url() works in CSS, JS & rhtml templates.  IT  
will search all of your linked bundles (including SproutCore) to find  
the image you name.  You can also leave off the file extension if you  
want.  This way you can change image file types without having to edit  
your code.

-Charles

On Jun 19, 2008, at 7:55 AM, Erich Ocean wrote:


    Reply to author    Forward  
You must Sign in before you can post messages.
To post a message you must first join this group.
Please update your nickname on the subscription settings page before posting.
You do not have the permission required to post.
Joshua Dickens  
View profile  
 More options Jun 19 2008, 11:45 am
From: Joshua Dickens <jdick...@apple.com>
Date: Thu, 19 Jun 2008 08:45:48 -0700
Local: Thurs, Jun 19 2008 11:45 am
Subject: Re: [sproutcore] Re: Using SproutCore Server with another server
One thing to add about static_url (though it might be obvious).  If  
will use the first item it finds (I think it searches alphabetically,  
but I'm not sure). So if you have multiple files of the same name (in  
different subfolders) you can give it a more specific path to use,  
i.e., static_url('lores/logo') vs static_url('hires/logo').

josh


    Reply to author    Forward  
You must Sign in before you can post messages.
To post a message you must first join this group.
Please update your nickname on the subscription settings page before posting.
You do not have the permission required to post.
End of messages
« Back to Discussions « Newer topic     Older topic »

Create a group - Google Groups - Google Home - Terms of Service - Privacy Policy
©2009 Google