How to set up the path to my custom Gas3 template? - apache-flex

Gas3 is not able to find my custom template.
I replaced the default path:
class:org/granite/generator/template/remoteBase.gsp
With my file, like this:
class:myPackage/remoteBase.gsp
But every time Gas3 tries to create the .as of my classes I get a Resource not Found exception.
I tried different paths but all gave me the same error.

Found out that the path to the custom template has to be declared differently.
Like this:
file:///myPackage/remoteBase.gsp

Related

Ruby on Rails - Using helpers inside css erb file gives undefined method

I have a css.erb file which contains the styling of one of my pages. I have a helper which preformats a URL of a given image based on the location of that image.
When I call the helper function from the view, the output is expected (a string containing the URL for of the image). However, calling it in the css.erb file gives me an undefined method error even though I copy and paste the same function into my css file.
It's as if the helper is not included in the css file and is ignored.
Helpers are not available by default to templated .css files. They are intended to help in view construction only. However, you can try the workaround mentioned here using an initializer:
Rails.application.assets.context_class.instance_eval do
include YourHelperModule
end
Alternatively, if you only need this for one or a few files, you can use the solution mentioned here, by adding this code to the top of the .css.erb file:
<% environment.context_class.instance_eval { include YourHelperModule } %>

Jade - calling page specific css pages

I have page specific css files I would like to call automatically. Does anyone have a nice way of doing this elegantly?
This should do it
link(rel="stylesheet", href="#{req.path + '.css'}", type="text/css")
Where you pass either req (the request object) as a local variable when rendering the jade template (or even just pass in req.path as path). This could just be handled in your layout.jade and it will work for each of your route paths.
If you want to get fancy, you could establish a consistent pattern where a page's route maps 1 to 1 to a filesystem path for a .css file in your public directory. In that case you could easily but the stylesheet link tag inside a conditional and only link to the .css file if you find a matching one on disk.

Extending parent routing when extending bundles

In Symfony2 (2.0.3) I have a BetaBundle that is set as the parent of a AlphaBundle. Is it possible to override some routes while still keeping the parent originals routing definition ?
I have tried importing the parent routing.yml inside the child routing.yml file but it naturally result in a circular reference exception.
Is there any standard way to achieve this using yml and files named routing.yml in the same relative path ?
When you override your AlphaBundle anything that uses the #AlphaBundle shortcut will look in #BetaBundle first. The only way I've found to solve this kind of problem is to have the extending bundle (BetaBundle) quit using the # shortcut, and include your AlphaBundle's route using it's path.
As an alternative you could try renaming your BetaBundle's route file so that it doesn't override AlphaBundle's file, and then configure your app/config/routing.yml to include your BetaBundle's renamed routing file.

Using directives in new files

Is it possible to have additional "using" directives automatically added to my new aspx.cs files so that I do not have to keep typing the same ones over and over again (i.e. custom namespace using directives)
You can edit the files that are used by the template. Better yet, create your own. File + Export Template.
You don't have to type them in. When writing the code, type in the name of the class (without the namespace). Then hit CTRL+.. That will open up the resolve type intellisense helper. It will add the using statement to the top of the file. No scrolling necessary.

Getting a directory's path, that is inside an assembly

I have a custom asp.net control. That control will also render to the page a piece of javascript. This javascript piece of code is actually properties that have to be initialized. One of this property value must be a path. This path is a directory that is inside this assembly. If it is was a file i would use GetWebResourceUrl but now I don't know what commands to use.
Also I would like to know, if I get the dir path the files inside it will be available for the javascript to use them or not?
Try this: System.Reflection.Assembly.GetExecutingAssembly().Location

Resources