hi, i have a view called forum which is a form and i want to show the data below the form when user fill the form. i have this code in Blog controller def forum if request.post? and params[:blog} @blog = Blog.new(params[:blog]) if @blog.save redirect_to :action => "show" end end end def show @z=Blog.return_forum end end in this code it shows data in a seperate page called show.but i want to show data in the page itself(forum page)..plz can anyone tell me how can i do it --~--~---------~--~----~------------~-------~--~----~ 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-/JYPxA39Uh5TLH3MbocFFw@public.gmane.org To unsubscribe from this group, send email to rubyonrails-talk+unsubscribe-/JYPxA39Uh5TLH3MbocFFw@public.gmane.org For more options, visit this group at http://groups.google.com/group/rubyonrails-talk?hl=en -~----------~----~----~----~------~----~------~--~---
use ajax. On Nov 3, 2:14 pm, "Ishara Gunathilake" <jaimgunathil...-Re5JQEeQqe8AvxtiuMwx3w@public.gmane.org> wrote:> hi, i have a view called forum which is a form and i want to > show the data below the form when user fill the form. > i have this code in Blog controller > > def forum > if request.post? and params[:blog} > @blog = Blog.new(params[:blog]) > if @blog.save > redirect_to :action => "show" > end > end > end > > def show > @z=Blog.return_forum > end > end > > in this code it shows data in a seperate page called show.but i want to show > data > in the page itself(forum page)..plz can anyone tell me how can i do it--~--~---------~--~----~------------~-------~--~----~ 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-/JYPxA39Uh5TLH3MbocFFw@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 -~----------~----~----~----~------~----~------~--~---
Use ajax or else instead of redirecting to show method , write the content of show in the forum itself. if request.post? and params[:blog] @blog=Blog.new(params[:blog]) if @blog.save On Nov 3, 2:14 pm, "Ishara Gunathilake" <jaimgunathil...-Re5JQEeQqe8AvxtiuMwx3w@public.gmane.org> wrote:> hi, i have a view called forum which is a form and i want to > show the data below the form when user fill the form. > i have this code in Blog controller > > def forum > if request.post? and params[:blog} > @blog = Blog.new(params[:blog]) > if @blog.save > redirect_to :action => "show" > end > end > end > > def show > @z=Blog.return_forum > end > end > > in this code it shows data in a seperate page called show.but i want to show > data > in the page itself(forum page)..plz can anyone tell me how can i do it--~--~---------~--~----~------------~-------~--~----~ 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-/JYPxA39Uh5TLH3MbocFFw@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 -~----------~----~----~----~------~----~------~--~---
Use ajax or else instead of redirecting to show method , write the content of show in the forum itself. def forum if request.post? and params[:blog] @blog=Blog.new(params[:blog]) if @blog.save flash[:notice]="Forum successfully posted" else flash[:error]="Sorry! try it again" end end @z=Blog.return_forum end On Nov 3, 2:14 pm, "Ishara Gunathilake" <jaimgunathil...-Re5JQEeQqe8AvxtiuMwx3w@public.gmane.org> wrote:> hi, i have a view called forum which is a form and i want to > show the data below the form when user fill the form. > i have this code in Blog controller > > def forum > if request.post? and params[:blog} > @blog = Blog.new(params[:blog]) > if @blog.save > redirect_to :action => "show" > end > end > end > > def show > @z=Blog.return_forum > end > end > > in this code it shows data in a seperate page called show.but i want to show > data > in the page itself(forum page)..plz can anyone tell me how can i do it--~--~---------~--~----~------------~-------~--~----~ 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-/JYPxA39Uh5TLH3MbocFFw@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 -~----------~----~----~----~------~----~------~--~---