Hello All, I am working on a microblogging application.(similar to twitter) In my controller there is a method called replypopUp.It is a method that runs when the reply link on timeline is clicked.When I a click on the link a pop-up appears in which there is a text area and a post button.Inside the text area,the name of the user to whom I am replying should appear in the form ''@username:'' Now in my controller method I am taking that user''s name using @posted_by_name = params[:posted_by] In my view my text area looks like this <textarea name="message" id="message" maxlength ="400" style="overflow:auto;width:100%;height: 56px ;"onkeyup="checkPostFieldLength(message,''remaining'', 400);"onkeydown="checkPostFieldLength(message,''remaining'', 400);"onmouseout="checkPostFieldLength(message,''remaining'', 400);">@< %=h @posted_by_name %>:</textarea> The text within <% %> is the username I am trying to paste by default inside the text area However when I run the application,I only get" @:" in the text area.The name of the user does not appear. I have also tried to check using http watch,and I see the url being passed correctly,so there is no chance of params[:posted_by] being taken as a null value. Kindly let me know if my way of displaying the valaue is incorrect.If yes how should I display it in my view? Thanks in Advance Regards Chandrika -- You received this message because you are subscribed to the Google Groups "Ruby on Rails: Talk" group. To post to this group, send email to rubyonrails-talk-/JYPxA39Uh5TLH3MbocFF+G/Ez6ZCGd0@public.gmane.org To unsubscribe from this group, send email to rubyonrails-talk+unsubscribe-/JYPxA39Uh5TLH3MbocFF+G/Ez6ZCGd0@public.gmane.org For more options, visit this group at http://groups.google.com/group/rubyonrails-talk?hl=en.
On 3 March 2011 07:43, Chandu80 <chandu.shenoy-Re5JQEeQqe8AvxtiuMwx3w@public.gmane.org> wrote:> Hello All, > I am working on a microblogging application.(similar to twitter) > In my controller there is a method called replypopUp.It is a method > that runs when the reply link on timeline is clicked.When I a click on > the link a pop-up appears in which there is a text area and a post > button.Inside the text area,the name of the user to whom I am replying > should appear in the form ''@username:'' > Now in my controller method I am taking that user''s name using > @posted_by_name = params[:posted_by]Use ruby-debug (see the Rails Guide on debugging if you do not know how to do this) to break in here and examine @posted_by_name> In my view my text area looks like this > > <textarea name="message" id="message" maxlength ="400" > style="overflow:auto;width:100%;height: > 56px ;"onkeyup="checkPostFieldLength(message,''remaining'', > 400);"onkeydown="checkPostFieldLength(message,''remaining'', > 400);"onmouseout="checkPostFieldLength(message,''remaining'', 400);">@< > %=h @posted_by_name %>:</textarea>What happens if you just have, just to check it is not an issue with the text area <p>@<%= h posted_by_name %>:</p>> > The text within <% %> is the username I am trying to paste by default > inside the text area > However when I run the application,I only get" @:" in the text > area.The name of the user does not appear. > I have also tried to check using http watch,and I see the url being > passed correctly,so there is no chance of params[:posted_by] being > taken as a null value.You can check the params by looking in log/development.log. Colin -- You received this message because you are subscribed to the Google Groups "Ruby on Rails: Talk" group. To post to this group, send email to rubyonrails-talk-/JYPxA39Uh5TLH3MbocFF+G/Ez6ZCGd0@public.gmane.org To unsubscribe from this group, send email to rubyonrails-talk+unsubscribe@googlegroups.com. For more options, visit this group at http://groups.google.com/group/rubyonrails-talk?hl=en.
Hi, I tried executing the below statement and it just gave me "@:"> What happens if you just have, just to check it is not an issue with > the text area > <p>@<%= h posted_by_name %>:</p> >Regards Chandrika On Mar 3, 1:36 pm, Colin Law <clan...-gM/Ye1E23mwN+BqQ9rBEUg@public.gmane.org> wrote:> On 3 March 2011 07:43, Chandu80 <chandu.she...-Re5JQEeQqe8AvxtiuMwx3w@public.gmane.org> wrote: > > > Hello All, > > I am working on a microblogging application.(similar to twitter) > > In my controller there is a method called replypopUp.It is a method > > that runs when the reply link on timeline is clicked.When I a click on > > the link a pop-up appears in which there is a text area and a post > > button.Inside the text area,the name of the user to whom I am replying > > should appear in the form ''@username:'' > > Now in my controller method I am taking that user''s name using > > @posted_by_name = params[:posted_by] > > Use ruby-debug (see the Rails Guide on debugging if you do not know > how to do this) to break in here and examine @posted_by_name > > > In my view my text area looks like this > > > <textarea name="message" id="message" maxlength ="400" > > style="overflow:auto;width:100%;height: > > 56px ;"onkeyup="checkPostFieldLength(message,''remaining'', > > 400);"onkeydown="checkPostFieldLength(message,''remaining'', > > 400);"onmouseout="checkPostFieldLength(message,''remaining'', 400);">@< > > %=h @posted_by_name %>:</textarea> > > What happens if you just have, just to check it is not an issue with > the text area > <p>@<%= h posted_by_name %>:</p> > > > > > The text within <% %> is the username I am trying to paste by default > > inside the text area > > However when I run the application,I only get" @:" in the text > > area.The name of the user does not appear. > > I have also tried to check using http watch,and I see the url being > > passed correctly,so there is no chance of params[:posted_by] being > > taken as a null value. > > You can check the params by looking in log/development.log. > > Colin-- You received this message because you are subscribed to the Google Groups "Ruby on Rails: Talk" group. To post to this group, send email to rubyonrails-talk-/JYPxA39Uh5TLH3MbocFF+G/Ez6ZCGd0@public.gmane.org To unsubscribe from this group, send email to rubyonrails-talk+unsubscribe@googlegroups.com. For more options, visit this group at http://groups.google.com/group/rubyonrails-talk?hl=en.
On 3 March 2011 10:39, Chandu80 <chandu.shenoy-Re5JQEeQqe8AvxtiuMwx3w@public.gmane.org> wrote:> Hi, > I tried executing the below statement and it just gave me "@:" > >> What happens if you just have, just to check it is not an issue with >> the text area >> <p>@<%= h posted_by_name %>:</p>I meant @posted_by_name of course. Sorry. By the way could you not top post please, it makes it difficult to follow the thread. Insert your reply at appropriate point(s) in previous message. Thanks Colin -- You received this message because you are subscribed to the Google Groups "Ruby on Rails: Talk" group. To post to this group, send email to rubyonrails-talk-/JYPxA39Uh5TLH3MbocFF+G/Ez6ZCGd0@public.gmane.org To unsubscribe from this group, send email to rubyonrails-talk+unsubscribe-/JYPxA39Uh5TLH3MbocFF+G/Ez6ZCGd0@public.gmane.org For more options, visit this group at http://groups.google.com/group/rubyonrails-talk?hl=en.
Hi, I also tried <p>@<%=h @posted_by_name.inspect %>:</p> and it gave @nil: Some null value being returned from URL. Thanks for the help. Regards Chandrika On Mar 3, 1:36 pm, Colin Law <clan...-gM/Ye1E23mwN+BqQ9rBEUg@public.gmane.org> wrote:> On 3 March 2011 07:43, Chandu80 <chandu.she...-Re5JQEeQqe8AvxtiuMwx3w@public.gmane.org> wrote: > > > Hello All, > > I am working on a microblogging application.(similar to twitter) > > In my controller there is a method called replypopUp.It is a method > > that runs when the reply link on timeline is clicked.When I a click on > > the link a pop-up appears in which there is a text area and a post > > button.Inside the text area,the name of the user to whom I am replying > > should appear in the form ''@username:'' > > Now in my controller method I am taking that user''s name using > > @posted_by_name = params[:posted_by] > > Use ruby-debug (see the Rails Guide on debugging if you do not know > how to do this) to break in here and examine @posted_by_name > > > In my view my text area looks like this > > > <textarea name="message" id="message" maxlength ="400" > > style="overflow:auto;width:100%;height: > > 56px ;"onkeyup="checkPostFieldLength(message,''remaining'', > > 400);"onkeydown="checkPostFieldLength(message,''remaining'', > > 400);"onmouseout="checkPostFieldLength(message,''remaining'', 400);">@< > > %=h @posted_by_name %>:</textarea> > > What happens if you just have, just to check it is not an issue with > the text area > <p>@<%= h posted_by_name %>:</p> > > > > > The text within <% %> is the username I am trying to paste by default > > inside the text area > > However when I run the application,I only get" @:" in the text > > area.The name of the user does not appear. > > I have also tried to check using http watch,and I see the url being > > passed correctly,so there is no chance of params[:posted_by] being > > taken as a null value. > > You can check the params by looking in log/development.log. > > Colin-- You received this message because you are subscribed to the Google Groups "Ruby on Rails: Talk" group. To post to this group, send email to rubyonrails-talk-/JYPxA39Uh5TLH3MbocFF+G/Ez6ZCGd0@public.gmane.org To unsubscribe from this group, send email to rubyonrails-talk+unsubscribe@googlegroups.com. For more options, visit this group at http://groups.google.com/group/rubyonrails-talk?hl=en.
On 3 March 2011 10:47, Chandu80 <chandu.shenoy-Re5JQEeQqe8AvxtiuMwx3w@public.gmane.org> wrote:> Hi,By the way could you not top post please, it makes it difficult to follow the thread. Insert your reply at appropriate point(s) in previous message. Thanks> I also tried <p>@<%=h @posted_by_name.inspect %>:</p> and it gave > > @nil:In that case, obviously, @posted_by_name is nil. What did you see when you used ruby-debug to break into the controller code? Colin -- You received this message because you are subscribed to the Google Groups "Ruby on Rails: Talk" group. To post to this group, send email to rubyonrails-talk-/JYPxA39Uh5TLH3MbocFF+G/Ez6ZCGd0@public.gmane.org To unsubscribe from this group, send email to rubyonrails-talk+unsubscribe@googlegroups.com. For more options, visit this group at http://groups.google.com/group/rubyonrails-talk?hl=en.
Hi Colin, Sorry for the email clutter. I am actually working on jRuby on Rails. And the organisation I work in allows only the approved gems to be installed. However I could track the nil value from the development log file. Thanks for the help. Regards Chandrika On Mar 3, 6:28 pm, Colin Law <clan...-gM/Ye1E23mwN+BqQ9rBEUg@public.gmane.org> wrote:> On 3 March 2011 10:47, Chandu80 <chandu.she...-Re5JQEeQqe8AvxtiuMwx3w@public.gmane.org> wrote: > > > Hi, > > By the way could you not top post please, it makes it difficult to > follow the thread. Insert your reply at appropriate point(s) in > previous message. Thanks > > > I also tried <p>@<%=h @posted_by_name.inspect %>:</p> and it gave > > > @nil: > > In that case, obviously, @posted_by_name is nil. What did you see > when you used ruby-debug to break into the controller code? > > Colin-- You received this message because you are subscribed to the Google Groups "Ruby on Rails: Talk" group. To post to this group, send email to rubyonrails-talk-/JYPxA39Uh5TLH3MbocFF+G/Ez6ZCGd0@public.gmane.org To unsubscribe from this group, send email to rubyonrails-talk+unsubscribe@googlegroups.com. For more options, visit this group at http://groups.google.com/group/rubyonrails-talk?hl=en.