views:

40

answers:

2

hi

help me to write rails code to remove comma for the below code

<%
student = []
student << "About Section:"
student << student_input(@input, :section_name)
student << student_input(@input, :section_strength)
%>
<%= student.join(", ") %>

I have output for this as " About Section:, section name, section strength "

I just want to remove the comma(,) following "About Section:,"

+4  A: 

Seems like it'd be easier just to do this:

About Section: <%= student_input @input, :section_name %>, <%= student_input @input, :section_string %>
mipadi
+1  A: 

Here ya go:

"#{student.shift} #{student.join(', ')"
btelles