# Check the text within a div element from controller

**URL:** <https://www.ruby-forum.com/t/check-the-text-within-a-div-element-from-controller/123037>\
**Category:** Rails\
**Created:** [December 13, 2007, 3:56pm UTC](https://www.ruby-forum.com/t/check-the-text-within-a-div-element-from-controller/123037 "2007-12-13T15:56:00Z")\
**Posts on this page:** 1\
**Page:** 1

<div class="post-metadata">

**Author:** ![gorgeoussoul](https://www.ruby-forum.com/letter_avatar_proxy/v4/letter/g/6f9a4e/32.png) [@gorgeoussoul](https://www.ruby-forum.com/u/gorgeoussoul)\
**Post date:** [December 13, 2007, 3:56pm UTC](https://www.ruby-forum.com/t/check-the-text-within-a-div-element-from-controller/123037/1 "2007-12-13T15:56:00Z")

</div>

Is there any way to check for a specific line of text within a div  
element from the controller?

I’m changing a block of filtered results and the text in a div element  
(‘Show All’ vs. ‘Limit to Mine’). When another filter is run against  
the same block of filtered results I want to see which text is inside  
the div (‘show all’ or ‘limit to mine’), so I’ll know if I should  
include [“people\_id = ?”, @person] in my list of conditions.

I know I could set a database field everything I change the div, but is  
there anyway to just check the div while building the condition string?

Thanks!
