[Rails] Re: validation message in other module
please help on this is urgent...
On May 2, 2:54 pm, Rahul Mehta <rahul23134...@gmail.com> wrote:
> i am having one comment module and putted the two validation and i
> have putted or copy the code of the add form of this module to my
> public module
>
> and when user add comment from the public module the customer flag is
> 1
> and validations are not working how i can make it work
>
> my comment module create function is this and m using this function
> for both the module..
>
> def create
> @comment = Comment.new(params[:comment])
> respond_to do |format|
> if @comment.save
> flash[:notice] = 'comment was successfully created.'
> if(params[:customer]=="1")
>
> format.html { redirect_to root_url+params[:menu]
> +"/"+params[:menu1] }
> else
> #format.html{render :text=>params[:customer]}
> format.html { redirect_to(@comment) }
> end
> format.xml { render :xml => @comment, :status
> => :created, :location => @comment }
> else
> if(params[:customer]=="1")
> format.html { redirect_to root_url+params[:menu]
> +"/"+params[:menu1] }
> else
> format.html { render :action => "new" }
> end
>
> format.xml { render :xml => @comment.errors, :status
> => :unprocessable_entity }
> end
> end
>
> end
>
> please help ASAP.
>
> thanks
>
> rahul
>
> --
> 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@googlegroups.com.
> To unsubscribe from this group, send email to rubyonrails-talk+unsubscribe@googlegroups.com.
> For more options, visit this group athttp://groups.google.com/group/rubyonrails-talk?hl=en.
--
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@googlegroups.com.
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.

0 Comments:
Post a Comment
Subscribe to Post Comments [Atom]
<< Home