>
> > Mohammed, you can write the above as follows:
> > @property.destroy if IsAuthorized?(@property.user_id)
>
> Well, you could, *if* IsAuthorized? -- which idiomatically should
> be is_authorized? -- returned a boolean value :-)
>
Personally I'd prefer authorized? - I never use is_...?, the is_
On 26 April 2010 01:16, Mohammed Alenazi wrote:
> Hi
>
> I have this code
> def destroy
> �...@property = Property.find(params[:id])
> IsAuthorized?(@property.user_id)
> �...@property.destroy
>
> respond_to do |format|
> format.html { redirect_to(properties_url) }
> format.xml
On Sun, Apr 25, 2010 at 5:20 PM, Conrad Taylor wrote:
> Mohammed, you can write the above as follows:
> @property.destroy if IsAuthorized?(@property.user_id)
Well, you could, *if* IsAuthorized? -- which idiomatically should
be is_authorized? -- returned a boolean value :-)
>> def IsAuthorized?
On Sun, Apr 25, 2010 at 5:16 PM, Mohammed Alenazi wrote:
> Hi
>
> I have this code
> def destroy
>@property = Property.find(params[:id])
> IsAuthorized?(@property.user_id)
>@property.destroy
>
>
Mohammed, you can write the above as follows:
@property.destroy if IsAuthorized?(@property
Hi
I have this code
def destroy
@property = Property.find(params[:id])
IsAuthorized?(@property.user_id)
@property.destroy
respond_to do |format|
format.html { redirect_to(properties_url) }
format.xml { head :ok }
end
end
def IsAuthorized?(id)
if current_
5 matches
Mail list logo