I use Ember 1.0.0 and i can not update to new versions now. I need a solution for Ember 1.0.0.
For example Google Adwords needs to pass custom parameters to visited website so Analytics can measure the traffic. I need to have it.
So for example URL is: mywebsite.com/someemberpage/?utm_source=test&utm_medium=test&utm_term=test&utm_content=test&utm_campaign=test
But after website loads Ember strips custom parameter. How to prevent it without updating Ember.js?
( In case Ember does not strip custom parameters please write, because if so, some JS code on my website does this. Thanks! )
Deprecated but these might be what your looking for...
https://github.com/knownasilya/ember-query-params
https://github.com/alexspeller/ember-query
In the past we used ember-query-params. It did the job just fine.
Hope this helps,
Jeff
Related
This question is related to: Ember Octane How to Clear Form Errors?
I have been asking a lot of questions on how to upgrade my Ember Classic project to Ember Octane. Some users in the community have suggested that I post an Ember-Twiddle for them to see what is going on. I have tried doing that, but I cannot get it to work. This is another tool for me to learn and I am struggling a bit to make heads or tails of it while trying to also NOT post my entire project as that seems unnecessary.
Why do I not see the page links for change-password and myroute2?
https://ember-twiddle.com/364eaf05a2e1072994b61f255032eb62?openFiles=templates.application%5C.hbs%2C
The hint is the browser's console:
you first trying to extend your change-password from unknown mixin and after fixing that you'd see another error re unknown services in the change-password controllers. Comment them out and everything works.
I am planning an Ember web app which I want to operate on one page without page reloads.
However, I also want to be able to share the state of the app at any time, and therefore make use of Ember's URL-centric design.
As a total Ember noob, I am wondering if and how Ember accomplishes this (relying on routes, but without page reloads).
Any info is greatly appreciated!
I would recommend reading up on "Query Parameters" (see here) as that is the feature it sounds like you are looking for.
I have a method inside a Model that returns an image URL as a String such as: "assets/myImage.png", this works well in production without CDN, the image is being served.
Using the CDN (Cloudfront) serves only files with its fingerprint or that's what I've read. So when I open up my Google Console it shows "assets/myImage.png", but not the fingerprinted version, so it obviously doesn't show the image.
In short: I need to know how to use a helper method that returns the fingerprinted version of my image inside a Model.
Any help would be great!
I believe you can access the Sprockets helper using:
self.class.helpers.asset_path('application.css') or
self.class.helpers.asset_digest_path('application.css')
Both of these are a backward way of getting access to the helpers that Sprockets uses for fingerprinting assets in production. Does that work?
Based on this SO answer
You should be able to get the URL from the ruby aws-sdk gem.
Here are the docs for AWS::CloudFront::Client
Update: This answer is wrong. See my different answer below.
I actually don't think my above answer will work. Instead, try this instide production.rb
config.action_controller.asset_host = "d24xjtg100euk4.cloudfront.net"
That should append the CDN url to all your rails helpers (like image_helper).
You could also roll your own custom helper that takes the asset location and concatenates it with the CDN url.
Based on this blog post: SETTING UP A CLOUDFRONT CDN FOR RAILS
EDIT: Posted another answer below using Sprockets helper method.
Its a quick question but I was wondering if it was possible to remove the # symbole from the URL in emberjs ? I know its not possible in many framwork, but I was curious to know about ember.
And if yes, how is it possible ?
If I understand it right removing the hash would defeat the whole point of using ember.js as other urls would point to other html pages and when you use ember.js you download only one page.
Yes you can see the relevant part in the Ember Guide
Keep in mind that doing so would mean that you need to configure your server to serve the ember app for all the possible routes that you can accept
it is also possible for you to make it so that the page that's served with such a route would have the added benefit of a normal emberless page in it's noscript tag as a form of SEO optimization (trying to reason why you would do this)
more can be found in the API Docs
revealing the nice option of using location:auto instead of location:history providing a more backwards compatible solution
App.Router.reopen({
location: 'auto'
});
I am concerned about page ranking on google with the following situation:
I am looking to convert my existing site with 150k+ unique page results to a ember app, off the route. so currently its something like domain.com/model/id - With ember and hash change - it will be /#/model/id. I really want history state but lack of IE support doesn't leave that as a option. So my Sitemap for google has lots and lots of great results using the old model/id. On the rails side I will test browser for compatibility, before either rendering the JS rich app or the plain HTML / CSS. Does anyone have good SEO suggestions with my current schema for success.
Linked below is my schema and looking at the options -
http://static.allplaces.net/images/EmberTF.pdf
History state is awesome but it looks like support is only around 60% of browsers.
http://caniuse.com/history
Thanks guys for the suggestions, the google guide is similar to what I'm going to try. I will roll it out to 1 client this month, and see what webmasters and analytics show.
here is everything you need to have your hash links be seo friendly: https://developers.google.com/webmasters/ajax-crawling/
basically You write Your whole app with hashlinks, but You have to add "!" to them, so You have #!/model/id. Next You must have all pages somewhere generated and if google asks for them, return "plain html" as described here: https://developers.google.com/webmasters/ajax-crawling/docs/getting-started
use google webmaster tools to check if Your site is crawlable.
I'm not sure if you're aware that you can configure Ember to use the browser history for the location API and keep using your pages the way they are reference now. All you need to do is configure the Route's location property
App.Router.reopen({
location: 'history'
});
See more details about specifying the location api here