Question: I have the following code:

```
account = Account.find(1)
customer = ThirdPartyAPI.retrieve("123456")
account.customers.import(customer)

```

And here's the import method:

```
class Customer < ActiveRecord::Base
   belongs_to :account

   def self.import(customer)
      # I need to get the Account ID. 
      # Have tried `self.account.id`, but it throws this:
      # NoMethodError: undefined method `account'
   end
end

```

From within that `import` method, I'm trying to get the main account ID. As you can see in my code comment, when I try to call `self.account.id` it throws a `NoMethodError: undefined method 'account'` error.

My Account model has the association setup:

```
class Account < ActiveRecord::Base
  has_many :customers
end

```

Answer: 
There is a bit of a fundamental problem with your question in that `HTML5` is not really a *thing*. It's hard to compare it to Java or Flash, which are programming languages. It is possible to create interactive applications using HTML and JavaScript without using any of the features of HTML5. This seems to happen a lot, but for simplicity these are often referred to as HTML5 applications -- especially by non-technical people.

1) I would say that JavaScript can be as powerful as the other compiled languages you talk about even on a webpage -- especially with the power of `<canvas>`. You have found that HTML5 has won for a reason. In my opinion, it can do what the others can do and is simpler to implement.

There is nothing that forbids you from including Flash objects of Applets alongside JavaScript, though, and they can even interact.

2) There is nothing that prevents all of your HTML/JavaScript from being downloaded in the browser and viewed in plain text, although it can be obfuscated with tools such as [Uglify](http://marijnhaverbeke.nl/uglifyjs).

It's also possible to download and decompile swfs and jars from a web interface, so compiling does not necessarily offer you a lot of protection anyway. Your code would be protected by Copyright (at least in the US) and you could use a license [the MIT license](http://opensource.org/licenses/MIT) too.

3) All the work is done by the browser. The client will only need a browser to run your code, but some browsers do not support some features you may want to use. This especially applies to older browsers.

There are a ton of frameworks and libraries out there for creating rich HTML/JavaScript applications, but these are just are mostly just JavaScript files.
HTML5 is a brand and trend. In silverlight/flash/html battle HTML must be the winner. Because browsers can't progress fragmentary. Is it true then some part of features developing in browser plugins, some part in browsers. For strong and fast progress always, at the start, needs the vector. In redefining web in our life such vector is HTML5. HTML5 is not a language, it is the set of capabilities, such video, music, webgl, geolocation, semantic essences and more and more only from browser. And we can't speek here about HTML5 like a language.

All your questions are about javascript.

1. Want `bytecode inside <object> ... </object>`? Use Chrome Native Client.
2. Want to hide your code? Use any obfuscator.
3. Modern javascript engines has just-in-time compilation. And there is the "subset" of javascript like `asm.js` which is just 2x slower then C++.