Questions tagged [rails-cells]

Cells - View Components for Rails

Cells are view components for Rails. They are mini-controllers with their own MVC stack, can invoke logic and render views. They bring back OOP to Rails' view layer and make writing reusable portlets for your applications fun.

http://cells.rubyforge.org

39 questions
8
votes
1 answer

Can't use cells from an engine inside Rails application

I created an engine which provides an ui component as a cell. The corresponding gem (criteria_operator-ui_component) contains nearly no code inside the lib folder, because for cells to function properly I had to work inside the assets path. The base…
Florian Koch
  • 1,372
  • 1
  • 30
  • 49
7
votes
2 answers

How to access 'can?' method from within cell?

I'm using cancan and cells gems in my ruby-on-rails project. How to access can? method from within cell? Thanks.
6
votes
0 answers

Can rails' cells embed their own javascript and css?

I've read several example regarding cells for rails but did not find some example showing how to create a completely isolated widget from a cell. By isolated, I mean a widget that has its own css / javascript / ... and that only need to be copied in…
Luc
  • 16,604
  • 34
  • 121
  • 183
4
votes
3 answers

Kaminari::Cells paginate method not rendering anything

I'm using the Kaminari::Cells gem, and when I use the paginate method in a cell view, nothing shows up. I checked, and the paginate method is just returning "\n".
neurodynamic
  • 4,294
  • 3
  • 28
  • 39
4
votes
1 answer

Testing Cells in isolation with Rspec - any recommandation?

I'm giving a try to Apotonick's Trailblazer gem, which brings more structure on top of Rails, and I really like what I tried so far, while not having embraced all of it yet. And this is one strength of Trailblazer, you can dive into it…
demental
  • 1,444
  • 13
  • 25
3
votes
3 answers

How can I reuse components and widgets in other Rails apps? Is that a good idea?

I have built mini widgets that consist of a model, a controller a couple of stylesheets and a couple of lines of javascript. Whenever it turns out that I need something like that in the next app I am building, i have to do some copypasta from the…
picardo
  • 24,530
  • 33
  • 104
  • 151
3
votes
2 answers

superclass mismatch error from class in Trailblazer operation when making changes to Rails code while server is running

I'm using the Trailblazer gem with Rails, and there's a Cell class inside one of my Trailblazer operations that starts throwing a superclass mismatch error whenever I change the code with the server running. If I start the server and immediately…
neurodynamic
  • 4,294
  • 3
  • 28
  • 39
3
votes
1 answer

Rendering a rails cell from a controller with an implicit model

I'm trying to use the Rails Cell Gem (https://github.com/apotonick/cells), but I'm having some trouble rendering a cell from a controller and a view. This is my cell (simplified): class AcquiredSkillsCell < Cell::ViewModel def show render …
Sam Stickland
  • 637
  • 1
  • 6
  • 17
3
votes
1 answer

New and Create actions using Cells

I am trying to implement the Cells gem in a Rails 4 project. I am a little bit confused about rendering a form Cell for a model. I looked around on Google but can't seem to find a tutorial covering this. Most tutorials only cover a :show Cell. Is…
HermannHH
  • 1,732
  • 1
  • 27
  • 57
2
votes
1 answer

Rails Cells seems not caching

I'm building a rails project, which recently needs a cache system. I'm using Cells to build cache mechanism. view code: = cell(:payment).(:ccc) viewmodel: class PaymentCell < Cell::ViewModel cache :ccc def ccc puts '!!!!!!!!!!!!!!!!!!!!' …
Mozzan
  • 283
  • 1
  • 2
  • 13
2
votes
2 answers

Something like Merb Parts in Rails 3?

Is there anything like Merb Parts in Rails 3 out there now? I've seen Rails Cells, but felt like nobody was using them. What are your thoughts? Are these suitable for widgets?
Lance
  • 75,200
  • 93
  • 289
  • 503
2
votes
1 answer

undefined method render_cell for Rails 3 Engine

I created a mountable engine with rails plugin new golgi --mountable. The cells gem was added as a dependency on the gemspec file: s.add_dependency "cells". Bundling, and running the generator rails g cell cart show produced the following…
RailinginDFW
  • 1,523
  • 12
  • 19
1
vote
1 answer

Missing partial in gmaps4rails when called from a 'cell' renderer

I'm using gem gmaps4rails and gem cells both of which by themselves work brilliantly. However I've created a cell with haml = gmaps(@options) and I get the error Missing partial /gmaps4rails/gmaps4rails with {:locale=>[:en], :formats=>[:html],…
1
vote
0 answers

Cell inheritance does not work in Cells-3.7.0, rails 3.1.1

I have a problem using inheritance in cells-3.7.0 gem with rails 3.1.1. Looks like a bug, but I'm not sure. I have a Sidebar with a bunch of buttons that are displayed or not depending on different parameters. I am trying to use Cells to take out…
Simon Bagreev
  • 2,879
  • 1
  • 23
  • 24
1
vote
3 answers

What kind of traction does cells have in the Rails community?

I am commencing a Rails build and have been looking at Cells - seems like a powerful piece of kit. What kind of real traction does cells have in the community at large and is it worth implementing for a site that is likely to have a fairly complex…
buddhamagnet
  • 230
  • 2
  • 11
1
2 3