Menu icon Foundation

My Posts


My Comments

Sumit Kapur commented on Stéphane Richin's post over 5 years

Crap. I didn't use the Insert Code functionality. So here is my answer again:

Hello Stephane. I think I got it!

Here's the deal.

Make a link and empty reveal modal div as below:

 <a data-reveal-id="myModal" data-reveal-ajax="http://0.0.0.0:3000/posts/5346cc00c5a2219d670000ee" data-reveal>
  Click Me For A Modal
</a>
<div id="myModal" class="reveal-modal" data-reveal>
</div>

You see above I also have the link to the content hard coded into the data-reveal-ajax attribute. This will call the show template for my posts controller. This link must return something very simple. in fact the link must return only what should be placed inside the empty reveal modal div above. So it cannot use the regular application.html.erb layout. You need a new layout. I created modal.html.erb in views/layouts which is just:

<%= yield %> 

Then at the top of my posts controller, I have:

layout "modal", only: [:show]

This makes it so the show action uses the modal layout. So now I set posts/show.html.erb to:

<a class="close-reveal-modal">&#215;</a>
hi 

And wala! It works. The key is that the link "http://0.0.0.0:3000/posts/5346cc00c5a2219d670000ee" must only return some content for inside the div. It can't have a div with class = reveal-modal or any start and end html tags or anything like that.
Good luck buddy!

Sumit Kapur commented on Stéphane Richin's post over 5 years

I too am having this problem and am using the same example as Stephane. Any help would be appreciated!

Sumit Kapur commented on Sumit Kapur's post over 5 years

OK - Now I fixed the modal issue. Modals now have the data-reveal attribute in F5 and didn't in F4. Who the hell needs you guys? Just kidding.

I do think the docs could be improved. Especially, the whole delete the old gem manually business. Otherwise, I think I might be ok. Thanks.

Sumit Kapur commented on Sumit Kapur's post over 5 years

OK - now I have come up with something. I found the old files for the old gem living in:
/usr/local/rvm/gems/ruby-2.0.0-p247/gems

I deleted them and fascinatingly things seem to be working better. My modals are broken but now at least the error went away and my buttons look like F5 buttons.

Is this unique to me or should there be a step added to the instructions to delete the old gem files? Also, if anybody knows why my modals are broken that would be interesting to know.

Sumit Kapur commented on Sumit Kapur's post over 5 years

Also, my buttons still look like F4 buttons, which is very strange because I thought I had uninstalled F4 by removing the gem from the gemfile, running bundle install and manually deleting files and references from the assets directory...

Posts Followed

No Content

Following

    No Content

Followers

My Posts

My Comments

You commented on Stéphane Richin's post over 5 years

Crap. I didn't use the Insert Code functionality. So here is my answer again:

Hello Stephane. I think I got it!

Here's the deal.

Make a link and empty reveal modal div as below:

 <a data-reveal-id="myModal" data-reveal-ajax="http://0.0.0.0:3000/posts/5346cc00c5a2219d670000ee" data-reveal>
  Click Me For A Modal
</a>
<div id="myModal" class="reveal-modal" data-reveal>
</div>

You see above I also have the link to the content hard coded into the data-reveal-ajax attribute. This will call the show template for my posts controller. This link must return something very simple. in fact the link must return only what should be placed inside the empty reveal modal div above. So it cannot use the regular application.html.erb layout. You need a new layout. I created modal.html.erb in views/layouts which is just:

<%= yield %> 

Then at the top of my posts controller, I have:

layout "modal", only: [:show]

This makes it so the show action uses the modal layout. So now I set posts/show.html.erb to:

<a class="close-reveal-modal">&#215;</a>
hi 

And wala! It works. The key is that the link "http://0.0.0.0:3000/posts/5346cc00c5a2219d670000ee" must only return some content for inside the div. It can't have a div with class = reveal-modal or any start and end html tags or anything like that.
Good luck buddy!

You commented on Stéphane Richin's post over 5 years

I too am having this problem and am using the same example as Stephane. Any help would be appreciated!

You commented on Sumit Kapur's post over 5 years

OK - Now I fixed the modal issue. Modals now have the data-reveal attribute in F5 and didn't in F4. Who the hell needs you guys? Just kidding.

I do think the docs could be improved. Especially, the whole delete the old gem manually business. Otherwise, I think I might be ok. Thanks.

You commented on Sumit Kapur's post over 5 years

OK - now I have come up with something. I found the old files for the old gem living in:
/usr/local/rvm/gems/ruby-2.0.0-p247/gems

I deleted them and fascinatingly things seem to be working better. My modals are broken but now at least the error went away and my buttons look like F5 buttons.

Is this unique to me or should there be a step added to the instructions to delete the old gem files? Also, if anybody knows why my modals are broken that would be interesting to know.

You commented on Sumit Kapur's post over 5 years

Also, my buttons still look like F4 buttons, which is very strange because I thought I had uninstalled F4 by removing the gem from the gemfile, running bundle install and manually deleting files and references from the assets directory...

Posts Followed

No Content

Following

  • No Content

Followers

  • No Content