# app/helpers/reqeusts_helper.rbmodule RequestsHelper
phone = string.insert 3, "-"
phone.insert 7, "-"
I ran into a problem using the method directly as a helper. I solved the problem by moving the method to the Request model and serializing the returned value (along with the other attributes). Since this method will be called for all requests, I added a simple check for the presence of a user’s
It’s nice to have options. Enter Ruby on Rails’s
collection_select form helper. It generates an HTTP
<select> tag and
<option> tags that render a dropdown menu with multiple options
(Note: the helper method
collection_radio_buttons are similar, except they display each collection item with a checkbox or, you guessed it, a radio button.)
collection_select(object, method, collection, value_method, text_method)
Creates HTML that looks something like:
<select name="object[method]" id="object_method">
Each item from the
collection array is represented by an
<option> tag. You can access the
value_method of the submitted info through the params hash.
We Americans waste 25 to 40% of all our food. It’s taking over our landfills, releasing environmentally harmful methane gas. Food insecurity is another major issue we face. 1 in 8 of us is food insecure, lacking consistent access to enough food. On the other hand, some of us have too much. Every week my friend buys a pizza, and every week there are 2-3 large slices that grow lonely and old in the fridge. What if every week he could donate a few fresh slices to a hungry person (me for example)? What if a family could enjoy the…
You learn something new every day, they say. For me this has been especially apparent lately as I venture into new (to me) coding territory with the Flatiron School. I reached my second of five portfolio projects, and it’s an exciting time for a nerd like me. The project is a chance to build something that’s totally me, to explore, to dive deeper.
I’ve been thinking a lot about time. The more it passes, the faster it seems to slip by. Summer is on the downswing already. Pumpkin spice is back in a week and sweater weather is most likely…
For the final project in the Ruby object-oriented programming unit in Flatiron School’s Online Web Developer program, I am building command-line interface data gem. I’m incredibly excited to have a personalized project. Where else can you visualize something you wished existed and then bring it into existence? Bringing an app to life from a blank screen in a text editor feels almost like a violation of the first law of thermodynamics. Somethingness emerging from nothingness!
After an excessive amount of brainstorming with a friend, I settle on building a gem that spits out a random book excerpt and gives the…
Studying web dev at Flatiron School