unix timestamp => TS = Time.now.to_i
get hash => HASH = Digest::SHA1.hexdigest(sharedsecret+TS)
Api Key => AKEY
AKEY and sharedsecret will be mailed to you once you apply for API
http://www.slideshare.net/developers/documentation
for ex:
http://www.slideshare.net/api/1/get_slideshow?api_key=AKEY&ts=TS&hash=HASH&username=UN&password=PWD&slideshow_id=Sid
Wednesday, December 12, 2007
Tuesday, December 11, 2007
Adding classes/style to django form elements
The 'attrs' argument to the Widget class used with each particular
Field (the Widget is what actually renders the HTML) accepts a
dictionary which will become HTML attribute names and values. For
example:
username = forms.CharField(widget=forms.TextInput(attrs={'class': 'myclass'}))
will become:
the old forms default of having class attributes for each
input type (e.g. class=vTextField for type=text)
Field (the Widget is what actually renders the HTML) accepts a
dictionary which will become HTML attribute names and values. For
example:
username = forms.CharField(widget=forms.TextInput(attrs={'class': 'myclass'}))
will become:
the old forms default of having class attributes for each
input type (e.g. class=vTextField for type=text)
Sunday, December 09, 2007
populating select box from database ror
controller code looks something like:
class testController < ApplicationController
def test
@categories= Category.find_all
end
end
use
<%= options_from_collection_for_select @categories, 'id', 'name' %>
to populate the select box
class testController < ApplicationController
def test
@categories= Category.find_all
end
end
use
<%= options_from_collection_for_select @categories, 'id', 'name' %>
to populate the select box
Subscribe to:
Posts (Atom)