Gelmiş geçmiş en büyük porno sitemiz olan 2pe de her zaman en kaliteli pornoları sunmayı hedefledik. Diğer video sitemiz olan vuam da ise hd porno ağırlıklı çalışmalara başladık.

  1. #1
    Sencha User
    Join Date
    Dec 2010
    Posts
    18
    Vote Rating
    1
    Jeff Blake is on a distinguished road

      0  

    Default Integrating Sencha with Ruby on Rails: Views... JSON, HTML?

    Integrating Sencha with Ruby on Rails: Views... JSON, HTML?


    Hello everyone,
    I'm new to Sencha Touch but already recognize the power of it. Im looking for some structural tips on how I should go about programming the views for my app - as Im new to protocols like JSON.

    I have a webapp Im programming in Rails, and there are currently no views implemented besides scaffolds.

    I want to use Sencha Touch as my view for both web and mobile. (for web, thoughts? Is this a good idea? I find the kitchen sink pretty awesome and using this framework for both views seems like a time saver and simplifies code)

    If this is the case, should I be sending data from rails to the views using JSON? or HTML? I'm having a tough time wrapping my head around executing this.


    Thanks, Jeff

  2. #2
    Sencha User tomalex0's Avatar
    Join Date
    Apr 2009
    Location
    San Jose, CA
    Posts
    589
    Vote Rating
    16
    tomalex0 will become famous soon enough

      0  

    Default


    Hi Jeff,

    Sencha Touch mainly focused on Webkit browsers now. So if you are planning to use Sencha Touch App for Web, it will be working only with Safari,Chrome browsers and not with Firefox, Opera even though it supports HTML5.

    You better send data as JSON from Server and create Views using Sencha Touch then load Data for each Views using Stores and Models


    You can find more details on how to structure files here
    http://www.sencha.com/conference/ses...on.php?sid=322

  3. #3
    Sencha User
    Join Date
    Dec 2010
    Posts
    18
    Vote Rating
    1
    Jeff Blake is on a distinguished road

      0  

    Default


    That's a good point, I better create separate HTML views in rails.

    But are you saying I need to manage sencha in a whole new MVC? That sounds like kind of a headache dealing with two sets of MVCs (web and mobile).

    I guess when I think about it, it makes sense. I'm programming my desktop web app version in Rails and simultaneously feeding the desktop view using my rails Model. Then, Im building a new MVC for Sencha, and pulling data via JSON from the Rails Model. Is this correct? Is this a good approach?

    For a project that is primarily mobile (if not all mobile) it seems like this way sort of regards the mobile version as a spinoff.

  4. #4
    Sencha User
    Join Date
    Dec 2010
    Posts
    18
    Vote Rating
    1
    Jeff Blake is on a distinguished road

      0  

    Default


    Another quick point I want to bring up for discussion:

    Sencha is clearly a Declarative framework whereas others such as JQmobile, JQTouch, etc are markup based. I can see how easily the latter two could be used to create templates such as *.mobile.erb and stick them into the corresponding rails Views - thus creating a nicely integrated application. (Mobile Fu could be used to direct the rendering: format.mobile {render..)

    My question is, can this be done with Sencha? This saves the bloated need of programming separate application controllers in Sencha.

    I'm looking for the best way to stitch rails and sencha together. It seems there is very little documentation or discussion about this anywhere on the internet.

  5. #5
    Sencha User
    Join Date
    Feb 2011
    Posts
    2
    Vote Rating
    0
    antonysastre is on a distinguished road

      0  

    Default


    Jeff, the way I'm doing this while learning Sencha is using the solutions you mention above and sticking the JS in the rendered mobile template directly.

    I.e. Using mobile_fu to render *.mobile.erb templates and they just contain:

    Code:
    <script type='text/javascript> Ext.setup({..});</script>

  6. #6
    Ext JS Premium Member
    Join Date
    Sep 2007
    Posts
    29
    Vote Rating
    0
    xonmac is on a distinguished road

      0  

    Default


    I would also recommend having a look into Netzke, which allows for a modular approach to writing your apps. The support for Sencha Touch is still basic (there's no pre-built components, as in case of Ext JS), but it might be a place to start.
    Netzke: Ruby on Rails and Ext JS component framework.

Similar Threads

  1. JSON ComboBox with Ruby on Rails
    By leefaus in forum Ext 2.x: Help & Discussion
    Replies: 2
    Last Post: 9 Mar 2010, 5:15 AM
  2. extjs ruby on rails
    By olvap in forum Ext 3.x: Help & Discussion
    Replies: 3
    Last Post: 23 Jul 2009, 5:50 AM
  3. GridPanel + Ruby on Rails
    By danielbertini in forum Ext 2.x: Help & Discussion
    Replies: 2
    Last Post: 15 Oct 2007, 6:25 PM
  4. Json with Ruby on Rails
    By sfwalter in forum Ext 2.x: Help & Discussion
    Replies: 7
    Last Post: 16 Sep 2007, 7:57 PM

Thread Participants: 3