On 18jun, 2010, at 15:34 , Magnus Holm wrote:

> Oh, and I also have the speed issue! That's definitely a bug. I'll
> have a look at it later...

uffff, I was thinking it was my code ...

:-)

thanks !

regards,

r.


> 
> On Friday, June 18, 2010, Raimon Fernandez <co...@montx.com> wrote:
>> buf, now I'm lost ...
>> 
>> :-))
>> 
>> no, really, thanks for that info, now I have working as I want ...
>> 
>> :-)
>> 
>> 
>> I've tested and created a new databse, and is working also.
>> 
>> I've created a new sqlite3 from terminal and filled-up with some data and 
>> now I can use this databse from Camping, cool!
>> 
>> And, caping is serving the data with .xml format and I can get it from my 
>> devices, cool!
>> 
>> I'm going to play more with thise, sure I'll come back with more questions 
>> ...
>> 
>> :-)
>> 
>> ah, I always use Thin with Nginx for my RoR instead of Mongrel, I suppose 
>> there would be no problem with camping ?
>> 
>> and speed: normally it's all very fast, but sometimes, it takes a little bit 
>> (3 or more seconds) to respond camping, and I'm not doing nothing serious at 
>> all, just the example from pastie.
>> 
>> is because I'm using the development mode instead of production, like in RoR 
>> ?
>> 
>> thanks again !
>> 
>> regards,
>> 
>> r.
>> 
>> 
>> 
>> On 18jun, 2010, at 12:33 , Magnus Holm wrote:
>> 
>>> Yeah, people always get a little confused because you don't need to
>>> define your database when you're using bin/camping (it has a default
>>> SQLite database at ~/.camping.db).
>>> 
>>> I also see that there's some old, database code here; we definitely
>>> need to update our documentation (yes, I'm working on it!)
>>> 
>>> First of all, the table name should be "list_people" (since "people"
>>> is the plural to "person" and the table names are always in
>>> lowercase), but you should rather do `create_table Person.table_name`
>>> and `drop_table Person.table_name` because then you don't need to
>>> think about it at all :-)
>>> 
>>> Secondly, you only need this in order to create the database:
>>> 
>>> def List.create
>>>  List::Models.create_schema
>>> end
>>> 
>>> Then it will use a SQLite database at ~/.camping.db (as long as you
>>> start it with `camping list.rb`). This is perfect for just testing
>>> things out (you can also run `camping -C list.rb` to get an IRB
>>> console). Please note that if you only run `camping list.rb`, you'll
>>> have to load the page in the browser before the migrations run.
>>> 
>>> If you want to use a specific database, you can add this:
>>> 
>>> def List.create
>>>  List::Models::Base.establish_connection(
>>>    :adapter => "postgresql",
>>>    :username => "root",
>>>    :password => "toor,
>>>    :database => "list"
>>>  )
>>>  List::Models.create_schema
>>> end
>>> 
>>> Or you might want to add the information in a database.yml file:
>>> 
>>> ---
>>> adapter: postgresql
>>> username: root
>>> password: toor
>>> database: list
>>> 
>>> And then rather do:
>>> 
>>> require 'yaml'
>>> 
>>> def List.create
>>>  
>>> List::Models::Base.establish_connection(YAML.load(File.read("database.yml")))
>>>  List::Models.create_schema
>>> end
>>> 
>>> Please note that if you connect to a database which already has the
>>> tables, DON'T run `List::Models.create_schema` as this will probably
>>> delete the whole database. General rule: you only need migrations to
>>> setup the database.
>>> 
>>> --
>>> 
>>> And thirdly: Yes, we are aware of that the migration support isn't
>>> very nice. In the future we hope to have something like:
>>> 
>>> module List::Models
>>>  class Person
>>>    t.string :name
>>>  end
>>> end
>>> 
>>> def List.create
>>>  List::Models.setup!
>>> end
>>> 
>>> Until then, you'll have to stick with the current solution :-)
>>> 
>>> 
>>> // Magnus Holm
>>> 
>>> 
>>> 
>>> On Fri, Jun 18, 2010 at 11:09, Raimon Fernandez <co...@montx.com> wrote:
>>>> 
>>>> On 17jun, 2010, at 21:04 , Magnus Holm wrote:
>>>> 
>>>>> 
>>>>> That's (hopefully) the simplest way to generate XML with Camping.
>>>>> 
>>>>> You still need to create a model to store/retrieve the data. Before we
>>>>> can help you here, we need to know a few things: Is it going to fetch
>>>>> data from a specific place, or should it create its own database (from
>>>>> scratch)? Any specific database you want to use?
>>>>> 
>>>>> Here's a Pastie with all the code: http://pastie.org/1008983 (Should
>>>>> work on any version of Camping).
>>>> 
>>>> I'm trying to adapt your pastie to use a sqlite databse, but I'm having 
>>>> some errors that I can't see ...
>>>> 
>>>> Here's a Pastie with all code: http://pastie.org/1009797
>>>> 
>>>> I'm just trying to create with code a simple table called Persons with 
>>>> some fields but ...
>>>> 
>>>> :-)
>>>> 
>>>> Also,  I can't find where is creating the database ...
>>>> 
>>>> thanks,
>>>> 
>>>> regards,
>>>> 
>>>> r.
>>>> _______________________________________________
>>>> Camping-list mailing list
>>>> Camping-list@rubyforge.org
>>>>  <http://rubyforge.org/mailman/listinfo/camping-list>
> 
> -- 
> // Magnus Holm
> _______________________________________________
> Camping-list mailing list
> Camping-list@rubyforge.org
> http://rubyforge.org/mailman/listinfo/camping-list


_______________________________________________
Camping-list mailing list
Camping-list@rubyforge.org
http://rubyforge.org/mailman/listinfo/camping-list

Reply via email to