Skip to content

Instantly share code, notes, and snippets.

@marcpalmer
Created September 12, 2011 16:02
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save marcpalmer/1211626 to your computer and use it in GitHub Desktop.
Save marcpalmer/1211626 to your computer and use it in GitHub Desktop.
Resources Article 1 snippet 9
modules = {
common {
dependsOn "jquery-ui, jquery"
resource url:'css/main.css'
}
images {
resource url:'images/logo.png',
attrs:[width:400, height:180, alt:'ACME Corp.'],
disposition: 'image'
}
}
@djKianoosh
Copy link

When specifying attrs like this, if the tag in the gsp also specifies a width/height, which takes precedence?

@marcpalmer
Copy link
Author

I would try it and see :)

Although one shouldn't do this, is it will likely result in bad results surely?

@djKianoosh
Copy link

Haha, I agree. But sometimes we have the privilege of taking over old code, ya know? :) And say, for example, that old code had a lot of non-DRY stuff like that. Just saying, it helps to know what to expect, and then refactor where needed.

As for putting width/height here, vs in the html, I'm guessing a 'front end' html guy/gal would prefer to control that in the view code, but setting these as defaults might be a good compromise. Just thinking out loud...

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment