Where can I write methods to be used in a partial? (Ruby on Rails)

chicjean

I'm using a partial to render each row in a somewhat complex table (venues have many events and events have many attendees).

I have a method I'd like to use to determine the rowspan of each row dynamically depending on the number of attendees. I have the method, but I'm not sure where to house it to make it accessible to my partial... it didn't work in my helper file and I'm not entirely convinced that's where its supposed to go.

Any insight would be greatly appreciated.

Thank you!

YuKagi

I'm pretty sure your method should work from as a helper method. Have you verified that it is not being called?

Dropping a debugger in the method might help you track down what's going on. Maybe it's getting called and just not doing what you think it should be doing?

Collected from the Internet

Please contact [email protected] to delete if infringement.

edited at
0

Comments

0 comments
Login to comment

Related

From Dev

Where should I put methods to be used by multiple controllers in rails?

From Dev

Can I write validation logic in setter methods?

From Dev

Ruby on Rails 3.2.17 | How can i write a RegEx for UK Currency

From Dev

Ruby on Rails - Where to put these helper type methods

From Dev

How can i trap invocation of methods in ruby

From Dev

How can I use jTable in Ruby on Rails?

From Dev

Where can I define methods to be called on Tables?

From Dev

Ruby on Rails partial not rendering properly

From Dev

How can I correctly write the WHERE clause?

From Dev

Ruby on Rails Why can I not log in?

From Dev

Can I write PostgreSQL functions on Ruby on Rails?

From Dev

How do I check which controller is used to render a partial in Rails?

From Dev

Where can I use threads to improve these methods?

From Dev

How can I write an IIFE in Ruby?

From Dev

Rails 4: Can I pass a partial into a partial?

From Dev

RAILS 3: How can I reload a partial?

From Dev

How can I cleanly define "antonym" or "opposite" methods in Ruby / Rails?

From Dev

Ruby on Rails 3.2.17 | How can i write a RegEx for UK Currency

From Dev

A Ruby on Rails framework which can be used for website for an event organizer

From Dev

Ruby on Rails - Why can't I use ActiveRecord::Base methods? Where to use?

From Dev

Can I used a module inside of a module in Ruby?

From Dev

boolean methods in ruby on rails

From Dev

Disk is used but I can not see where

From Dev

refactoring ruby methods in rails

From Dev

Can I fake calling methods in Ruby tests?

From Dev

Ruby on Rails - Can I choose where a specific notice will be shown

From Dev

Can I put a Rails partial between two arrows?

From Dev

How to pass methods to the services from module where they are used ?(ruby)

From Dev

Where can I to write my logic in APIView?

Related Related

  1. 1

    Where should I put methods to be used by multiple controllers in rails?

  2. 2

    Can I write validation logic in setter methods?

  3. 3

    Ruby on Rails 3.2.17 | How can i write a RegEx for UK Currency

  4. 4

    Ruby on Rails - Where to put these helper type methods

  5. 5

    How can i trap invocation of methods in ruby

  6. 6

    How can I use jTable in Ruby on Rails?

  7. 7

    Where can I define methods to be called on Tables?

  8. 8

    Ruby on Rails partial not rendering properly

  9. 9

    How can I correctly write the WHERE clause?

  10. 10

    Ruby on Rails Why can I not log in?

  11. 11

    Can I write PostgreSQL functions on Ruby on Rails?

  12. 12

    How do I check which controller is used to render a partial in Rails?

  13. 13

    Where can I use threads to improve these methods?

  14. 14

    How can I write an IIFE in Ruby?

  15. 15

    Rails 4: Can I pass a partial into a partial?

  16. 16

    RAILS 3: How can I reload a partial?

  17. 17

    How can I cleanly define "antonym" or "opposite" methods in Ruby / Rails?

  18. 18

    Ruby on Rails 3.2.17 | How can i write a RegEx for UK Currency

  19. 19

    A Ruby on Rails framework which can be used for website for an event organizer

  20. 20

    Ruby on Rails - Why can't I use ActiveRecord::Base methods? Where to use?

  21. 21

    Can I used a module inside of a module in Ruby?

  22. 22

    boolean methods in ruby on rails

  23. 23

    Disk is used but I can not see where

  24. 24

    refactoring ruby methods in rails

  25. 25

    Can I fake calling methods in Ruby tests?

  26. 26

    Ruby on Rails - Can I choose where a specific notice will be shown

  27. 27

    Can I put a Rails partial between two arrows?

  28. 28

    How to pass methods to the services from module where they are used ?(ruby)

  29. 29

    Where can I to write my logic in APIView?

HotTag

Archive