Question: This is a question regarding Ajax Iframes.

I have a function to open an Iframe, and set its source, however at some points I would need to open multiple Iframes, and set their sources accordingly. The second iframe should only open if the first one has not finished loading.

Psudocode:

// at some point

```
x = iframe;
x.src = 'dothiscode.php'

```

// at some later point

```
if (x.src = not finished loading)
  y = new iframe;
  y.src = 'domorecode.php'
else
  x.src = 'domorecode.php'

```

---

Thank you for your help!

Answer: 
You are breaking the MVC paradigm, as you said. The point of MVC is to split everything up into bite-size chunks so it is more manageable. That's how I see it at least.

How would comments be created without a specific controller for them. The showing part on a `Post` is the easy part:

```
@comments = @post.comments

```
The more you deviate from the MVC paradigm, the more problems you'll have later on. For example, if you wanted to add admin views for your Comments, it would be easier to expand on it through the Comments Controller. Else, you'll end up having multiple actions for your comment in the Posts controller (eg. approve\_comment, delete\_comment, voteup\_comment, etc).

That being said, you can always wire things up so that actions on your comments direct the user back to the Post that originated it. So, comment related actions will reside in the Comments Controller, but the user is generally working with Posts (and its associated Comments).